⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 shapp.frm

📁 中国石化IC开发程序
💻 FRM
📖 第 1 页 / 共 2 页
字号:
Private Sub Command10_Click()
Dim psR As String
Dim pbIn(50) As Byte
mbRet = MW.Sam_Reset(psR)
If Not mbRet Then MsgBox MW.Errshow: Exit Sub
mbRet = MW.Sam_Delete(String(16, "F"))
'If Not mbRet Then MsgBox MW.Errshow: Exit Sub
mbRet = MW.Sam_Create_File_Psam(geU_CreateMF, "FFFFFFFFFFFFFFFF0f011234567890")
If Not mbRet Then MsgBox MW.Errshow: Exit Sub
'建立DIR文件-0001,42个字节
mbRet = MW.Sam_Create_File_Psam(geU_CreateEF, "0001020F0F0028")
If Not mbRet Then MsgBox MW.Errshow: Exit Sub
'写DIR文件
mbRet = MW.Sam_Select_File(geU_SelectEF, "0001")
If Not mbRet Then MsgBox MW.Errshow: Exit Sub
mbRet = MW.Sam_Append_Record_Psam("00", 19, "61114F09123456789012345601500450424F43")
If Not mbRet Then MsgBox MW.Errshow: Exit Sub
';公共应用信息文件-0015
mbRet = MW.Sam_Create_File_Psam(geU_CreateEF, "0015000F0F000E")
If Not mbRet Then MsgBox MW.Errshow: Exit Sub
';写公共应用基本文件
mbRet = MW.Asc_To_Hex("0001020304050607080942020100", pbIn(0), 14)
If Not mbRet Then MsgBox MW.Errshow: Exit Sub
mbRet = MW.Sam_Update_Binary_Psam(geU_Data, "95", 0, 14, pbIn())
If Not mbRet Then MsgBox MW.Errshow: Exit Sub
';终端信息文件-0016
mbRet = MW.Sam_Create_File_Psam(geU_CreateEF, "0016000F0F0006")
If Not mbRet Then MsgBox MW.Errshow: Exit Sub
';写持卡人基本文件
mbRet = MW.Asc_To_Hex("123456789012", pbIn(0), 6)
If Not mbRet Then MsgBox MW.Errshow: Exit Sub
mbRet = MW.Sam_Update_Binary_Psam(geU_Data, "96", 0, 6, pbIn())
If Not mbRet Then MsgBox MW.Errshow: Exit Sub
';建立密钥文件05
mbRet = MW.Sam_Create_File_Psam(geU_CreateEF, "3F01050F002018")
If Not mbRet Then MsgBox MW.Errshow: Exit Sub
';主控密钥
mbRet = MW.Sam_Write_Key_Psam(geU_WordInstall, "", "", "0100000F030FFF00112233445566778899AABBCCDDEEFF")
If Not mbRet Then MsgBox MW.Errshow: Exit Sub
';外部认证密钥
mbRet = MW.Sam_Write_Key_Psam(geU_WordInstall, "", "", "0200000F030FFF00112233445566778899AABBCCDDEEFF")
If Not mbRet Then MsgBox MW.Errshow: Exit Sub
';卡片维护密钥
mbRet = MW.Sam_Write_Key_Psam(geU_WordInstall, "", "", "0100010F030FFF00112233445566778899AABBCCDDEEFF")
If Not mbRet Then MsgBox MW.Errshow: Exit Sub
';消费密钥0级
mbRet = MW.Sam_Write_Key_Psam(geU_WordInstall, "", "", "0100020F030FFF12345678901234567890123456789012")
If Not mbRet Then MsgBox MW.Errshow: Exit Sub
';消费密钥1级
mbRet = MW.Sam_Write_Key_Psam(geU_WordInstall, "", "", "0200220F030FFF12345678901234567890123456789012")
If Not mbRet Then MsgBox MW.Errshow: Exit Sub
';消费密钥2级
mbRet = MW.Sam_Write_Key_Psam(geU_WordInstall, "", "", "0300420F030FFF12345678901234567890123456789012")
If Not mbRet Then MsgBox MW.Errshow: Exit Sub
';消费密钥3级
mbRet = MW.Sam_Write_Key_Psam(geU_WordInstall, "", "", "0400620F030FFF12345678901234567890123456789012")
If Not mbRet Then MsgBox MW.Errshow: Exit Sub

';建立DF 2F 01
mbRet = MW.Sam_Create_File_Psam(geU_CreateDF, "2F010F00123456789012345601")
If Not mbRet Then MsgBox MW.Errshow: Exit Sub
';石化应用信息文件-0015
mbRet = MW.Sam_Create_File_Psam(geU_CreateEF, "0015000F0F0019")
If Not mbRet Then MsgBox MW.Errshow: Exit Sub
';写公共应用基本文件
mbRet = MW.Asc_To_Hex("03111111111111111122222222222222222001020820020208", pbIn(0), 25)
If Not mbRet Then MsgBox MW.Errshow: Exit Sub
mbRet = MW.Sam_Update_Binary_Psam(geU_Data, "95", 0, 25, pbIn())
If Not mbRet Then MsgBox MW.Errshow: Exit Sub
'终端交易序号数据文件-0018
mbRet = MW.Sam_Create_File_Psam(geU_CreateEF, "0018000F0F0004")
If Not mbRet Then MsgBox MW.Errshow: Exit Sub
'写终端交易序号数据文件-0018
mbRet = MW.Asc_To_Hex("00000000", pbIn(0), 4)
If Not mbRet Then MsgBox MW.Errshow: Exit Sub
mbRet = MW.Sam_Update_Binary_Psam(geU_Data, "98", 0, 4, pbIn())
If Not mbRet Then MsgBox MW.Errshow: Exit Sub
';ET专用文件-0003
mbRet = MW.Sam_Create_File_Psam(geU_CreateEF, "00030600000015")
If Not mbRet Then MsgBox MW.Errshow: Exit Sub
';建立密钥文件05
mbRet = MW.Sam_Create_File_Psam(geU_CreateEF, "3F01050F002018")
If Not mbRet Then MsgBox MW.Errshow: Exit Sub
';主控密钥
mbRet = MW.Sam_Write_Key_Psam(geU_WordInstall, "", "", "0100000F030FFF00112233445566778899AABBCCDDEEFF")
If Not mbRet Then MsgBox MW.Errshow: Exit Sub
';外部认证密钥
mbRet = MW.Sam_Write_Key_Psam(geU_WordInstall, "", "", "0200000F030FFF00112233445566778899AABBCCDDEEFF")
If Not mbRet Then MsgBox MW.Errshow: Exit Sub
';卡片维护密钥
mbRet = MW.Sam_Write_Key_Psam(geU_WordInstall, "", "", "0100010F030FFF00112233445566778899AABBCCDDEEFF")
If Not mbRet Then MsgBox MW.Errshow: Exit Sub
';消费密钥0级
mbRet = MW.Sam_Write_Key_Psam(geU_WordInstall, "", "", "0100020F030FFF12345678901234567890123456789012")
If Not mbRet Then MsgBox MW.Errshow: Exit Sub
';消费密钥1级
mbRet = MW.Sam_Write_Key_Psam(geU_WordInstall, "", "", "0300220F030FFF12345678901234567890123456789012")
If Not mbRet Then MsgBox MW.Errshow: Exit Sub
';消费密钥2级
mbRet = MW.Sam_Write_Key_Psam(geU_WordInstall, "", "", "0200420F030FFF12345678901234567890123456789012")
If Not mbRet Then MsgBox MW.Errshow: Exit Sub
';消费密钥3级
mbRet = MW.Sam_Write_Key_Psam(geU_WordInstall, "", "", "0400620F030FFF12345678901234567890123456789012")
If Not mbRet Then MsgBox MW.Errshow: Exit Sub
';SUPERPIN
mbRet = MW.Sam_Write_Key_Psam(geU_WordInstall, "", "", "01000A0F030F331122334455667788")
If Not mbRet Then MsgBox MW.Errshow: Exit Sub
';PIN
mbRet = MW.Sam_Write_Key_Psam(geU_WordInstall, "", "", "01000B0F030F331234")
If Not mbRet Then MsgBox MW.Errshow: Exit Sub
';用户自定义密钥
mbRet = MW.Sam_Write_Key_Psam(geU_WordInstall, "", "", "01000F0F030FFF00112233445566778899AABBCCDDEEFF")
If Not mbRet Then MsgBox MW.Errshow: Exit Sub
';DSTK密钥
mbRet = MW.Sam_Write_Key_Psam(geU_WordInstall, "", "", "0100110F030FFF00112233445566778899AABBCCDDEEFF")
If Not mbRet Then MsgBox MW.Errshow: Exit Sub

mbRet = MW.Sam_Create_File_Psam(geU_CreateEndDF, "2F01")
If Not mbRet Then MsgBox MW.Errshow: Exit Sub
mbRet = MW.Sam_Create_File_Psam(geU_CreateEndMF, "")
If Not mbRet Then MsgBox MW.Errshow: Exit Sub
End Sub

Private Sub Command11_Click()
Dim psR As String
Dim pbIn(50) As Byte
mbRet = MW.Reset(psR)
If Not mbRet Then MsgBox MW.Errshow: Exit Sub
mbRet = MW.Select_File(geU_SelectMF, "3f00")
If Not mbRet Then MsgBox MW.Errshow: Exit Sub
mbRet = MW.Select_File(geU_SelectDFName, "A00000000386980701")
If Not mbRet Then MsgBox MW.Errshow: Exit Sub
mbRet = MW.Select_File(geU_SelectEF, "0015")
If Not mbRet Then MsgBox MW.Errshow: Exit Sub
mbRet = MW.Verify("1234")
If Not mbRet Then MsgBox MW.Errshow: Exit Sub
mbRet = MW.Sam_Reset(psR)
If Not mbRet Then MsgBox MW.Errshow: Exit Sub
mbRet = MW.Sam_Select_File_Psam(geU_SelectDFName, "123456789012345601")
If Not mbRet Then MsgBox MW.Errshow: Exit Sub
mbRet = MW.User_Psma_Grey_Lock("03", "123456789012", Format(Now, "yyyymmddhhmmss"), "03", "00", "1234567890123456", "", "", "00000100")
If Not mbRet Then MsgBox MW.Errshow: Exit Sub
End Sub

Private Sub Command2_Click()
Dim psR As String
Dim pbIn(50) As Byte
mbRet = MW.Reset(psR)
If Not mbRet Then MsgBox MW.Errshow: Exit Sub
mbRet = MW.Select_File(geU_SelectMF, "3f00")
If Not mbRet Then MsgBox MW.Errshow: Exit Sub
mbRet = MW.Select_File(geU_SelectDFName, "A00000000386980701")
If Not mbRet Then MsgBox MW.Errshow: Exit Sub
mbRet = MW.Verify("1234")
If Not mbRet Then MsgBox MW.Errshow: Exit Sub
mbRet = MW.Grey_Lock("03123456789012", "CF896E42A67B5E22C3A6CE33205B82B9")
If Not mbRet Then MsgBox MW.Errshow: Exit Sub
End Sub

Private Sub Command3_Click()
Dim psR As String
Dim pbIn(50) As Byte
mbRet = MW.Reset(psR)
If Not mbRet Then MsgBox MW.Errshow: Exit Sub
mbRet = MW.Select_File(geU_SelectMF, "3f00")
If Not mbRet Then MsgBox MW.Errshow: Exit Sub
mbRet = MW.Select_File(geU_SelectDFName, "A00000000386980701")
If Not mbRet Then MsgBox MW.Errshow: Exit Sub
mbRet = MW.Verify("1234")
If Not mbRet Then MsgBox MW.Errshow: Exit Sub
mbRet = MW.Credit_For_Load(geU_Bankbook, "0300001000123456789012", "9C90A23E18486D0340D5868B3BADA121")
If Not mbRet Then MsgBox MW.Errshow: Exit Sub
Dim psRec As String
mbRet = MW.Verify("1234")
If Not mbRet Then MsgBox MW.Errshow: Exit Sub
mbRet = MW.Select_File(geU_SelectEF, "0018")
If Not mbRet Then MsgBox MW.Errshow: Exit Sub
mbRet = MW.Read_Record(1, "04", 23, psRec)
If Not mbRet Then MsgBox MW.Errshow: Exit Sub
End Sub

Private Sub Command4_Click()
Dim psB As String
Dim psR As String
Dim pbIn(50) As Byte
mbRet = MW.Reset(psR)
If Not mbRet Then MsgBox MW.Errshow: Exit Sub
mbRet = MW.Select_File(geU_SelectMF, "3f00")
If Not mbRet Then MsgBox MW.Errshow: Exit Sub
mbRet = MW.Select_File(geU_SelectDFName, "A00000000386980701")
If Not mbRet Then MsgBox MW.Errshow: Exit Sub
mbRet = MW.Verify("1234")
If Not mbRet Then MsgBox MW.Errshow: Exit Sub
mbRet = MW.Get_Balance(geU_Bankbook, psB)
If Not mbRet Then MsgBox MW.Errshow: Exit Sub
End Sub

Private Sub Command5_Click()
Dim psR As String
Dim pbIn(50) As Byte
mbRet = MW.Reset(psR)
If Not mbRet Then MsgBox MW.Errshow: Exit Sub
mbRet = MW.Select_File(geU_SelectMF, "3f00")
If Not mbRet Then MsgBox MW.Errshow: Exit Sub
mbRet = MW.Select_File(geU_SelectDFName, "A00000000386980701")
If Not mbRet Then MsgBox MW.Errshow: Exit Sub
mbRet = MW.Verify("1234")
If Not mbRet Then MsgBox MW.Errshow: Exit Sub
mbRet = MW.Grey_Lock_And_Debit_For_Unlock("03123456789012", "CF896E42A67B5E22C3A6CE33205B82B9", "00000100")
If Not mbRet Then MsgBox MW.Errshow: Exit Sub
Dim psRec As String
mbRet = MW.Read_Record(1, "C4", 23, psRec)
If Not mbRet Then MsgBox MW.Errshow: Exit Sub
End Sub

Private Sub Command6_Click()
Dim psR As String
Dim pbIn(50) As Byte
mbRet = MW.Reset(psR)
If Not mbRet Then MsgBox MW.Errshow: Exit Sub
mbRet = MW.Select_File(geU_SelectMF, "3f00")
If Not mbRet Then MsgBox MW.Errshow: Exit Sub
mbRet = MW.Select_File(geU_SelectDFName, "A00000000386980701")
If Not mbRet Then MsgBox MW.Errshow: Exit Sub
mbRet = MW.Verify("1234")
If Not mbRet Then MsgBox MW.Errshow: Exit Sub
mbRet = MW.Get_Lock_Proof(geU_Read, psR)
If Not mbRet Then MsgBox MW.Errshow: Exit Sub
End Sub

Private Sub Command7_Click()
Dim psR As String
Dim pbIn(50) As Byte
mbRet = MW.Reset(psR)
If Not mbRet Then MsgBox MW.Errshow: Exit Sub
mbRet = MW.Select_File(geU_SelectMF, "3f00")
If Not mbRet Then MsgBox MW.Errshow: Exit Sub
mbRet = MW.Select_File(geU_SelectDFName, "A00000000386980701")
If Not mbRet Then MsgBox MW.Errshow: Exit Sub
mbRet = MW.Verify("1234")
If Not mbRet Then MsgBox MW.Errshow: Exit Sub
mbRet = MW.Grey_Unlock("03123456789012", "00000100", "4E223293BA66403AAB5149E7FDE46444")
If Not mbRet Then MsgBox MW.Errshow: Exit Sub
End Sub

Private Sub Command8_Click()
Dim psR As String
Dim pbIn(50) As Byte
mbRet = MW.Reset(psR)
If Not mbRet Then MsgBox MW.Errshow: Exit Sub
mbRet = MW.Select_File(geU_SelectMF, "3f00")
If Not mbRet Then MsgBox MW.Errshow: Exit Sub
mbRet = MW.Select_File(geU_SelectDFName, "A00000000386980701")
If Not mbRet Then MsgBox MW.Errshow: Exit Sub
mbRet = MW.Verify("1234")
If Not mbRet Then MsgBox MW.Errshow: Exit Sub
mbRet = MW.Debit_For_Purchase(geU_Bankbook, "0300000100123456789012", "12345678", "CF896E42A67B5E22C3A6CE33205B82B9")
If Not mbRet Then MsgBox MW.Errshow: Exit Sub
Dim psRec As String
mbRet = MW.Verify("1234")
If Not mbRet Then MsgBox MW.Errshow: Exit Sub
mbRet = MW.Select_File(geU_SelectEF, "0018")
If Not mbRet Then MsgBox MW.Errshow: Exit Sub
mbRet = MW.Read_Record(1, "04", 23, psRec)
If Not mbRet Then MsgBox MW.Errshow: Exit Sub
End Sub

Private Sub Command9_Click()
Dim psR As String
Dim pbIn(50) As Byte
mbRet = MW.Reset(psR)
If Not mbRet Then MsgBox MW.Errshow: Exit Sub
mbRet = MW.Select_File(geU_SelectMF, "3f00")
If Not mbRet Then MsgBox MW.Errshow: Exit Sub
mbRet = MW.Select_File(geU_SelectDFName, "A00000000386980701")
If Not mbRet Then MsgBox MW.Errshow: Exit Sub
mbRet = MW.Application_Unblock("C7C8D8829363357389ED234147551401")
If Not mbRet Then MsgBox MW.Errshow: Exit Sub
End Sub

Private Sub Form_Load()
Move (Screen.Width - Me.Width) / 2, (Screen.Height - Me.Height) / 2
mbRet = MW.Com_Open(geU_Com1, geU_Baud9600)
If Not mbRet Then MsgBox MW.Errshow: Exit Sub
End Sub

Private Sub Form_Unload(Cancel As Integer)
mbRet = MW.Com_Close
If Not mbRet Then MsgBox MW.Errshow: Exit Sub
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -