?? sample.frm
字號:
VERSION 5.00
Object = "{BDC217C8-ED16-11CD-956C-0000C04E4C0A}#1.1#0"; "TABCTL32.OCX"
Begin VB.Form Form1
Caption = "Example for MWRF32.dll"
ClientHeight = 4620
ClientLeft = 60
ClientTop = 345
ClientWidth = 6450
BeginProperty Font
Name = "宋體"
Size = 9
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
LinkTopic = "Form1"
MaxButton = 0 'False
ScaleHeight = 4620
ScaleWidth = 6450
StartUpPosition = 2 'CenterScreen
WhatsThisHelp = -1 'True
Begin TabDlg.SSTab SSTab1
Height = 4335
Left = 0
TabIndex = 0
Top = 240
Width = 6465
_ExtentX = 11404
_ExtentY = 7646
_Version = 393216
Tabs = 2
TabHeight = 882
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋體"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
TabCaption(0) = "M1 Card"
TabPicture(0) = "sample.frx":0000
Tab(0).ControlEnabled= -1 'True
Tab(0).Control(0)= "Picture1"
Tab(0).Control(0).Enabled= 0 'False
Tab(0).Control(1)= "M1_init"
Tab(0).Control(1).Enabled= 0 'False
Tab(0).Control(2)= "M1_comm"
Tab(0).Control(2).Enabled= 0 'False
Tab(0).Control(3)= "M1_high"
Tab(0).Control(3).Enabled= 0 'False
Tab(0).Control(4)= "M1_device"
Tab(0).Control(4).Enabled= 0 'False
Tab(0).Control(5)= "M1_exit"
Tab(0).Control(5).Enabled= 0 'False
Tab(0).ControlCount= 6
TabCaption(1) = "ML Card"
TabPicture(1) = "sample.frx":001C
Tab(1).ControlEnabled= 0 'False
Tab(1).Control(0)= "ML_exit"
Tab(1).Control(1)= "ML_device"
Tab(1).Control(2)= "ML_comm"
Tab(1).Control(3)= "ML_init"
Tab(1).Control(4)= "Picture2"
Tab(1).ControlCount= 5
Begin VB.PictureBox Picture2
BackColor = &H00808000&
FillColor = &H000000FF&
FillStyle = 6 'Cross
BeginProperty Font
Name = "宋體"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H8000000D&
Height = 2895
Left = -74640
ScaleHeight = 2835
ScaleWidth = 3675
TabIndex = 12
Top = 840
Width = 3735
Begin VB.Label ML_label
Alignment = 2 'Center
AutoSize = -1 'True
BackStyle = 0 'Transparent
BeginProperty Font
Name = "宋體"
Size = 15.75
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H0000FFFF&
Height = 1230
Left = 345
TabIndex = 13
Top = 720
Width = 3030
WordWrap = -1 'True
End
End
Begin VB.CommandButton ML_init
Caption = "Initalize"
BeginProperty Font
Name = "宋體"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = -70680
TabIndex = 11
Top = 840
Width = 1815
End
Begin VB.CommandButton ML_comm
Caption = "Card Function"
BeginProperty Font
Name = "宋體"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = -70680
TabIndex = 10
Top = 1680
Width = 1815
End
Begin VB.CommandButton ML_device
Caption = "Device Function"
BeginProperty Font
Name = "宋體"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = -70680
TabIndex = 9
Top = 2520
Width = 1815
End
Begin VB.CommandButton ML_exit
Caption = "Exit"
BeginProperty Font
Name = "宋體"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = -70680
TabIndex = 8
Top = 3360
Width = 1815
End
Begin VB.CommandButton M1_exit
Caption = "Exit"
BeginProperty Font
Name = "宋體"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 4440
TabIndex = 6
Top = 3360
Width = 1695
End
Begin VB.CommandButton M1_device
Caption = "Device Function"
BeginProperty Font
Name = "宋體"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 4440
TabIndex = 5
Top = 2760
Width = 1695
End
Begin VB.CommandButton M1_high
Caption = "HL Function"
BeginProperty Font
Name = "宋體"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 4440
TabIndex = 4
Top = 2160
Width = 1695
End
Begin VB.CommandButton M1_comm
Caption = "Card Function"
BeginProperty Font
Name = "宋體"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 4440
TabIndex = 3
Top = 1560
Width = 1695
End
Begin VB.CommandButton M1_init
Caption = "Initalize"
BeginProperty Font
Name = "宋體"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 4440
TabIndex = 2
Top = 960
Width = 1695
End
Begin VB.PictureBox Picture1
BackColor = &H00808000&
FillColor = &H000000FF&
FillStyle = 6 'Cross
BeginProperty Font
Name = "宋體"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H8000000D&
Height = 2895
Left = 360
ScaleHeight = 2835
ScaleWidth = 3675
TabIndex = 1
Top = 840
Width = 3735
Begin VB.Label M1_label
Alignment = 2 'Center
AutoSize = -1 'True
BackStyle = 0 'Transparent
BeginProperty Font
Name = "宋體"
Size = 15.75
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H0000FFFF&
Height = 1440
Left = 90
TabIndex = 7
Top = 825
Width = 3255
WordWrap = -1 'True
End
End
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim akey(6) As Byte
Dim bkey(6) As Byte
Dim hexkey As String * 12
Dim displaydata(8) As Byte
Dim eepromdata As String * 32
Dim hardver As String * 20
Dim libver As String * 16
Dim ser As String * 16
Dim Snr As Long
Dim Rsnr As Long
Dim data16 As String * 16
Dim data32 As String * 32
Dim databuff32 As String * 32
Dim databuff16 As String * 16
Dim rvalue As Long
Dim wvalue As Long
Dim mlrvalue As Integer
Dim mlwvalue As Integer
Dim cardmode As Integer
Dim loadmode As Integer
Dim sector As Integer
Dim address As Integer
Dim ptrdest As String * 16
Dim ptrsource As String * 16
Dim time As String * 14
Dim timebuff As String * 14
Private Sub Form_Load()
icdev = -1
End Sub
Private Sub Form_Unload(Cancel As Integer)
quit
End Sub
Private Sub M1_comm_Click()
address = 9
sector = 2
cardmode = 1
st = rf_card(ByVal icdev, cardmode, Snr)
If st <> 0 Then
M1_label.Caption = "Call rf_card() error. Exit!"
Exit Sub
End If
loadmode = 0
sector = 4
st = rf_authentication(ByVal icdev, loadmode, sector)
If st <> 0 Then
M1_label.Caption = "Call rf_authentication() error.Exit!"
Exit Sub
End If
data32 = "1234567890abcdef1234567890abcdef"
st = rf_write_hex(ByVal icdev, address, ByVal data32)
If st <> 0 Then
M1_label.Caption = "Call rf_write_hex() error.Exit!"
Exit Sub
End If
st = rf_check_writehex(ByVal icdev, Snr, loadmode, address, data32)
If st <> 0 Then
M1_label.Caption = "Call rf_check_writehex() error.Exit!"
Exit Sub
End If
st = rf_read_hex(ByVal icdev, address, databuff32)
If st <> 0 Then
M1_label.Caption = "Call rf_read_hex error.Exit!"
Exit Sub
End If
'Modify the keys and some control bits
'Keep the following paramerters and keys same as the default
akey(0) = &HA0
akey(1) = &HA1
akey(2) = &HA2
akey(3) = &HA3
akey(4) = &HA4
akey(5) = &HA5
bkey(0) = &HB0
bkey(1) = &HB1
bkey(2) = &HB2
bkey(3) = &HB3
bkey(4) = &HB4
bkey(5) = &HB5
st = rf_changeb3(ByVal icdev, 2, akey(0), 0, 0, 0, 1, 0, bkey(0))
If st <> 0 Then
M1_label.Caption = "Call rf_changeb3() error.exit!"
Exit Sub
End If
'Value Operation
wvalue = 10000
st = rf_initval(ByVal icdev, address + 1, ByVal wvalue)
If st <> 0 Then
M1_label.Caption = "Call rf_initval() error.Exit!"
Exit Sub
End If
st = rf_restore(ByVal icdev, address + 1)
If st <> 0 Then
M1_label.Caption = "Call rf_restore() error.Exit!"
Exit Sub
End If
st = rf_transfer(ByVal icdev, address)
If st <> 0 Then
M1_label.Caption = "Call rf_transfer() error.Exit!"
Exit Sub
End If
st = rf_readval(ByVal icdev, address, rvalue)
If st <> 0 Then
M1_label.Caption = "Call rf_readval() error.Exit!"
Exit Sub
End If
st = rf_increment(ByVal icdev, address + 1, 520)
If st <> 0 Then
M1_label.Caption = "Call rf_increment() error.Exit!"
Exit Sub
End If
st = rf_decrement(ByVal icdev, address + 1, 520)
If st <> 0 Then
M1_label.Caption = "Call rf_decrement() error.Exit!"
Exit Sub
End If
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -