📄 解挂失
字号:
VERSION 5.00
Begin VB.Form frmjiegua
Caption = "Form2"
ClientHeight = 3360
ClientLeft = 3405
ClientTop = 1500
ClientWidth = 5625
LinkTopic = "Form2"
MaxButton = 0 'False
ScaleHeight = 3360
ScaleWidth = 5625
Begin VB.TextBox Text1
Height = 375
Left = 1200
TabIndex = 5
Top = 480
Width = 2175
End
Begin VB.TextBox Text2
Height = 375
Left = 1200
TabIndex = 4
Top = 1080
Width = 2175
End
Begin VB.TextBox Text3
Height = 375
Left = 1200
TabIndex = 3
Top = 1680
Width = 2175
End
Begin VB.TextBox Text4
Height = 375
Left = 1200
TabIndex = 2
Top = 2280
Width = 2175
End
Begin VB.CommandButton Command1
Caption = "解除挂失"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 3720
TabIndex = 1
Top = 1800
Width = 1575
End
Begin VB.CommandButton Command2
Caption = "读 卡"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 615
Left = 3720
TabIndex = 0
Top = 600
Width = 1455
End
Begin VB.Label Label2
Caption = "姓名:"
Height = 375
Left = 480
TabIndex = 9
Top = 600
Width = 615
End
Begin VB.Label Label3
Caption = "身份证号:"
Height = 255
Left = 120
TabIndex = 8
Top = 1200
Width = 975
End
Begin VB.Label Label4
Caption = "卡号:"
Height = 375
Left = 480
TabIndex = 7
Top = 1800
Width = 615
End
Begin VB.Label Label5
Caption = "剩余金额:"
Height = 255
Left = 120
TabIndex = 6
Top = 2400
Width = 975
End
Begin VB.Line Line4
X1 = 3480
X2 = 5160
Y1 = 1440
Y2 = 1440
End
Begin VB.Line Line5
X1 = 3480
X2 = 5160
Y1 = 1560
Y2 = 1560
End
End
Attribute VB_Name = "frmjiegua"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
'On Error GoTo lidierror
'lidierror:
' MsgBox "没有检测到有关设备,请检查设备是否连接好。", vbInformation, "错误!"
' Exit Sub
If Text3.Text = "" Then
MsgBox "没有读卡结果,无法挂失,请从新执行读卡操作!", vbInformation, "提示!"
Exit Sub
End If
Dim lidicn As New ADODB.Connection
Dim lidirs As New ADODB.Recordset
lidicn.Open "Provider = Microsoft.Jet.OLEDB.4.0; Data Source = 信息库.mdb;"
lidirs.Open "select * from 卡表 " + " where IC号 like" + "'" + Text3.Text + "'", lidicn, adOpenKeyset, adLockOptimistic
If lidirs.BOF Or lidirs.EOF Then
MsgBox "没有您要查询的结果,你使用了非法卡!", vbInformation, "提示!"
Exit Sub
End If
lidirs!是否挂失 = "No"
lidirs.Update
lidirs.Close
MsgBox "挂失解除完毕!", vbInformation, "提示"
End Sub
Private Sub Command2_Click()
On Error GoTo lidierror
lidierror:
MsgBox "没有检测到有关设备,请检查设备是否连接好。", vbInformation, "错误!"
Exit Sub
'打开连接
Dim kai As Integer
kai = MCS_InitComm(0, 115200)
If (kai <> 0) Then
MsgBox "没有检测到IC卡读写器。", vbInformation, "错误!"
MCS_LED (2)
Exit Sub
End If
'打开卡
Dim ka As Integer
Dim str0 As String
str0 = String(4, Str(0))
ka = SLE4442_OpenCard(str0)
If (ka <> 0) Then
MsgBox "读写器中没有卡,请检查卡是否插好。", vbInformation, "错误!"
MCS_LED (2)
Exit Sub
'Else
'MCS_LED (1)
End If
'读卡
'Dim i, iStart, iLen As Integer
Dim du As Integer
Dim str1 As String '读卡好
str1 = String(3, Chr(0))
du = SLE4442_ReadChar(32, 3, str1)
If (du <> 0) Then
MsgBox "数据读取失败!", vbInformation, "提示"
Exit Sub
Else
Text3.Text = str1
End If
str1 = String(4, Chr(0)) '读金额
du = SLE4442_ReadChar(35, 4, str1)
If (du <> 0) Then
MsgBox "数据读取失败!", vbInformation, "提示"
Exit Sub
Else
Text4.Text = str1
End If
Dim lidicn As New ADODB.Connection
Dim lidirs As New ADODB.Recordset
lidicn.Open "Provider = Microsoft.Jet.OLEDB.4.0; Data Source = 信息库.mdb;"
lidirs.Open "select * from 卡表 " + " where IC号 like" + "'" + Text3.Text + "'", lidicn
If (lidirs.BOF Or lidirs.EOF) Then
MsgBox "没有您要查询的结果,你使用了非法卡!", vbInformation, "提示!"
Exit Sub
Else
Text1.Text = lidirs!姓名
Text2.Text = lidirs!身份证号码
End If
'关闭连接和关闭卡
Dim guan As Integer
guan = SLE4442_CloseCard()
MCS_LED (2)
guan = MCS_ExitComm()
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -