📄 frmdecvalue.frm
字号:
VERSION 5.00
Begin VB.Form frmdecvalue
BackColor = &H00FFC0C0&
BorderStyle = 3 'Fixed Dialog
Caption = "Dec value windows"
ClientHeight = 2655
ClientLeft = 2760
ClientTop = 3750
ClientWidth = 4905
ControlBox = 0 'False
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2655
ScaleWidth = 4905
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 = 1200
TabIndex = 21
Top = 1320
Width = 2415
End
Begin VB.TextBox Textvalue
Height = 375
Left = 1200
TabIndex = 19
Top = 600
Width = 2415
End
Begin VB.TextBox Texthex
Height = 375
Index = 15
Left = 5640
TabIndex = 17
Top = 0
Visible = 0 'False
Width = 375
End
Begin VB.TextBox Texthex
Height = 375
Index = 14
Left = 5280
TabIndex = 16
Top = 0
Visible = 0 'False
Width = 375
End
Begin VB.TextBox Texthex
Height = 375
Index = 13
Left = 4920
TabIndex = 15
Top = 0
Visible = 0 'False
Width = 375
End
Begin VB.TextBox Texthex
Height = 375
Index = 12
Left = 4560
TabIndex = 14
Top = 0
Visible = 0 'False
Width = 375
End
Begin VB.TextBox Texthex
Height = 375
Index = 11
Left = 4200
TabIndex = 13
Top = 0
Visible = 0 'False
Width = 375
End
Begin VB.TextBox Texthex
Height = 375
Index = 10
Left = 3840
TabIndex = 12
Top = 0
Visible = 0 'False
Width = 375
End
Begin VB.TextBox Texthex
Height = 375
Index = 9
Left = 3480
TabIndex = 11
Top = 0
Visible = 0 'False
Width = 375
End
Begin VB.TextBox Texthex
Height = 375
Index = 8
Left = 3120
TabIndex = 10
Top = 0
Visible = 0 'False
Width = 375
End
Begin VB.TextBox Texthex
Height = 375
Index = 7
Left = 2760
TabIndex = 9
Top = 0
Visible = 0 'False
Width = 375
End
Begin VB.TextBox Texthex
Height = 375
Index = 6
Left = 2400
TabIndex = 8
Top = 0
Visible = 0 'False
Width = 375
End
Begin VB.TextBox Texthex
Height = 375
Index = 5
Left = 2040
TabIndex = 7
Top = 0
Visible = 0 'False
Width = 375
End
Begin VB.TextBox Texthex
Height = 375
Index = 4
Left = 1680
TabIndex = 6
Top = 0
Visible = 0 'False
Width = 375
End
Begin VB.TextBox Texthex
Height = 375
Index = 3
Left = 1320
TabIndex = 5
Top = 0
Visible = 0 'False
Width = 375
End
Begin VB.TextBox Texthex
Height = 375
Index = 2
Left = 960
TabIndex = 4
Top = 0
Visible = 0 'False
Width = 375
End
Begin VB.TextBox Texthex
Height = 375
Index = 1
Left = 600
TabIndex = 3
Top = 0
Visible = 0 'False
Width = 375
End
Begin VB.TextBox Texthex
Height = 375
Index = 0
Left = 240
TabIndex = 2
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 = 3000
Style = 1 'Graphical
TabIndex = 1
Top = 1920
Width = 1095
End
Begin VB.CommandButton cmdok
BackColor = &H00C0C000&
Caption = "Decrement 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 = 600
Style = 1 'Graphical
TabIndex = 0
Top = 1920
Width = 1815
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 = 360
TabIndex = 20
Top = 1320
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 = 360
TabIndex = 18
Top = 600
Width = 615
End
End
Attribute VB_Name = "frmdecvalue"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub OKButton_Click()
End Sub
Private Sub cmdcancel_Click()
Textvalue.Text = ""
Textstatus.Text = ""
frmdecvalue.Hide
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 cmdok_Click()
Dim datastring(0 To 15, 0 To 15) As Byte
Dim i As Integer
Dim j As Integer
If Blockstatus = 0 Then
MsgBox "Block 0 can't write"
Exit Sub
End If
i = Textvalue.Text \ 256
For j = 0 To i - 1
datastring(0, 0) = "&H" & Hex(255)
MifStatus = mifsw_decrement%(Blockstatus, datastring(0, 0))
MifStatus = mifsw_transfer%(Blockstatus)
If MifStatus <> 0 Then
MsgBox "Decrement value Error"
Exit Sub
End If
Next j
datastring(0, 0) = "&H" & Hex(Textvalue.Text - i * 256 + i)
MifStatus = mifsw_decrement%(Blockstatus, datastring(0, 0))
MifStatus = mifsw_transfer%(Blockstatus)
If MifStatus <> 0 Then
Textstatus.Text = "Decrement value Error"
Else
Textstatus.Text = "Decrement value Ok"
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -