📄 frmincvalue.frm
字号:
VERSION 5.00
Begin VB.Form frmincvalue
BackColor = &H00FFC0C0&
BorderStyle = 3 'Fixed Dialog
Caption = "Inc_value windows"
ClientHeight = 2955
ClientLeft = 2760
ClientTop = 3750
ClientWidth = 4560
ControlBox = 0 'False
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2955
ScaleWidth = 4560
ShowInTaskbar = 0 'False
Begin VB.TextBox Textstatus
BeginProperty Font
Name = "Times New Roman"
Size = 12
Charset = 0
Weight = 700
Underline = 0 'False
Italic = -1 'True
Strikethrough = 0 'False
EndProperty
ForeColor = &H0000FF00&
Height = 375
Left = 1080
TabIndex = 21
Top = 1080
Width = 2415
End
Begin VB.TextBox Texthex
Height = 375
Index = 15
Left = 5400
TabIndex = 19
Top = 0
Visible = 0 'False
Width = 375
End
Begin VB.TextBox Texthex
Height = 375
Index = 14
Left = 5040
TabIndex = 18
Top = 0
Visible = 0 'False
Width = 375
End
Begin VB.TextBox Texthex
Height = 375
Index = 13
Left = 4680
TabIndex = 17
Top = 0
Visible = 0 'False
Width = 375
End
Begin VB.TextBox Texthex
Height = 375
Index = 12
Left = 4320
TabIndex = 16
Top = 0
Visible = 0 'False
Width = 375
End
Begin VB.TextBox Texthex
Height = 375
Index = 11
Left = 3960
TabIndex = 15
Top = 0
Visible = 0 'False
Width = 375
End
Begin VB.TextBox Texthex
Height = 375
Index = 10
Left = 3600
TabIndex = 14
Top = 0
Visible = 0 'False
Width = 375
End
Begin VB.TextBox Texthex
Height = 375
Index = 9
Left = 3240
TabIndex = 13
Top = 0
Visible = 0 'False
Width = 375
End
Begin VB.TextBox Texthex
Height = 375
Index = 8
Left = 2880
TabIndex = 12
Top = 0
Visible = 0 'False
Width = 375
End
Begin VB.TextBox Texthex
Height = 375
Index = 7
Left = 2520
TabIndex = 11
Top = 0
Visible = 0 'False
Width = 375
End
Begin VB.TextBox Texthex
Height = 375
Index = 6
Left = 2160
TabIndex = 10
Top = 0
Visible = 0 'False
Width = 375
End
Begin VB.TextBox Texthex
Height = 375
Index = 5
Left = 1800
TabIndex = 9
Top = 0
Visible = 0 'False
Width = 375
End
Begin VB.TextBox Texthex
Height = 375
Index = 4
Left = 1440
TabIndex = 8
Top = 0
Visible = 0 'False
Width = 375
End
Begin VB.TextBox Texthex
Height = 375
Index = 3
Left = 1080
TabIndex = 7
Top = 0
Visible = 0 'False
Width = 375
End
Begin VB.TextBox Texthex
Height = 375
Index = 2
Left = 720
TabIndex = 6
Top = 0
Visible = 0 'False
Width = 375
End
Begin VB.TextBox Texthex
Height = 375
Index = 1
Left = 360
TabIndex = 5
Top = 0
Visible = 0 'False
Width = 375
End
Begin VB.TextBox Texthex
Height = 375
Index = 0
Left = 0
TabIndex = 4
Top = 0
Visible = 0 'False
Width = 375
End
Begin VB.CommandButton Cmdcancel
BackColor = &H00C0C000&
Caption = "Cancel"
BeginProperty Font
Name = "Times New Roman"
Size = 10.5
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 2760
Style = 1 'Graphical
TabIndex = 3
Top = 2040
Width = 1095
End
Begin VB.CommandButton Cmdok
BackColor = &H00C0C000&
Caption = "Increment value"
BeginProperty Font
Name = "Times New Roman"
Size = 10.5
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 360
Style = 1 'Graphical
TabIndex = 2
Top = 2040
Width = 1815
End
Begin VB.TextBox Textvalue
Height = 375
Left = 1080
TabIndex = 1
Top = 360
Width = 2415
End
Begin VB.Label Label2
BackColor = &H00FFC0C0&
Caption = "Status"
BeginProperty Font
Name = "Times New Roman"
Size = 12
Charset = 0
Weight = 700
Underline = 0 'False
Italic = -1 'True
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 240
TabIndex = 20
Top = 1080
Width = 735
End
Begin VB.Label Label1
BackColor = &H00FFC0C0&
Caption = "Value"
BeginProperty Font
Name = "Times New Roman"
Size = 10.5
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 240
TabIndex = 0
Top = 480
Width = 615
End
End
Attribute VB_Name = "frmincvalue"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub cmdcancel_Click()
Textvalue.Text = ""
Textstatus.Text = ""
frmincvalue.Hide
End Sub
Private Sub cmdok_Click()
Dim datastring(0 To 15, 0 To 15) As Byte
Dim i As Integer
Dim j As Integer
Call ReqtoAuthen(4)
i = Textvalue.Text \ 256
For j = 0 To i - 1
datastring(0, 0) = "&H" & Hex(255)
MifStatus = mifsw_increment%(17, datastring(0, 0))
MifStatus = mifsw_transfer%(17)
If MifStatus <> 0 Then
MsgBox "Increment value Error"
Exit Sub
End If
Next j
datastring(0, 0) = "&H" & Hex(Textvalue.Text - i * 256 + i)
MifStatus = mifsw_increment%(17, datastring(0, 0))
MifStatus = mifsw_transfer%(17)
If MifStatus <> 0 Then
Textstatus.Text = "Increment value -> Error"
Else
Textstatus.Text = "Increment value -> Ok"
End If
End Sub
Private Sub ReqtoAuthen(ByVal SecNr)
Call modestatus(modestring)
MifStatus = mifsw_request_2%(mode, tagtype) 'request mode= 1
If MifStatus <> 0 Then
MifStatus = mifsw_request_2%(mode, tagtype)
If MifStatus <> 0 Then
MsgBox "Request Error, " + CStr(MifStatus)
Exit Sub
End If
End If
MifStatus = mifsw_anticoll%(mode, snr)
If MifStatus <> 0 Then
MsgBox "Anticollision Error, " + CStr(MifStatus)
Exit Sub
End If
MifStatus = mifsw_select%(snr, Size(0))
If MifStatus <> 0 Then
MsgBox "Select Error, " + CStr(MifStatus)
Exit Sub
End If
MifStatus = mifsw_authentication%(mode, SecNr) 'mode=0, SecNr
If MifStatus <> 0 Then
Textstatus.Text = Textstatus.Text & "Authentication Error " & Chr(10)
Exit Sub
End If
End Sub
Private Sub modestatus(p As String)
If mode = 0 Then
p = " (KeyA KeySet0)"
Else
If mode = 1 Then
p = " (KeyA KeySet1)"
Else
If mode = 2 Then
p = " (KeyA KeySet2)"
Else
If mode = 4 Then
p = " (KeyB KeySet0)"
Else
If mode = 5 Then
p = " (KeyB KeySet1)"
Else
If mode = 6 Then
p = " (KeyB KeySet2)"
End If
End If
End If
End If
End If
End If
End Sub
Private Sub Form_Load()
MifStatus = mifsw_init%(1, baudrate)
If MifStatus < 0 Then
MsgBox "Init Error, " + CStr(MifStatus)
MifStatus = mifsw_exit%()
Exit Sub
End If
'*********reader configuration***************
MifStatus = mifsw_config%(&HC6, &HE)
If MifStatus <> 0 Then
MsgBox "Config Error, " + CStr(MifStatus)
MifStatus = mifsw_exit%()
Exit Sub
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -