回复 4楼 jklqwe111
我采用的是这样的方式进行比较的,比较完了没有重复将数据保存在slip No.dat中,下次入力重复该过程。
If Dir("C:\扫描入力\") = "" Then
MkDir ("C:\扫描入力\")
End If
lj1 = "C:\扫描入力\slip No.dat"
If Dir(lj1) = "" Then
Open lj1 For Output As #1
Close #1
End If
If TextBox4.Text <> "" Then
issame = False
Open lj1 For Binary As #1
If LOF(1) <> 0 Then
ReDim da(LOF(1) - 1) As Byte
Get #1, , da
End If
Close #1
da1 = Split(StrConv(da, vbUnicode), vbCrLf)
For j = 0 To UBound(da1)
If da1(j) = TextBox4.Text Then
issame = True: Exit For
End If
Next j
If issame = False Then
Label15.Caption = "OK"
Label15.FontSize = 14
Image4.BackColor = vbGreen
End If
If issame = True Then
Label15.Caption = "NG"
Label15.FontSize = 14
Image4.BackColor = vbRed
MsgBox "slip No 重复′"
End If
End If