⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 form1.frm

📁 磁条读写机
💻 FRM
字号:
VERSION 5.00
Begin VB.Form Form1 
   Caption         =   "读写卡器 write by alogo 2008"
   ClientHeight    =   4380
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   6585
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   ScaleHeight     =   4380
   ScaleWidth      =   6585
   StartUpPosition =   3  '窗口缺省
   Begin VB.CommandButton Command1 
      Caption         =   "批量写磁卡&B"
      Height          =   615
      Left            =   2400
      TabIndex        =   17
      Top             =   2640
      Width           =   1215
   End
   Begin VB.ComboBox Combo2 
      Height          =   300
      ItemData        =   "Form1.frx":0000
      Left            =   4680
      List            =   "Form1.frx":000D
      TabIndex        =   15
      Top             =   120
      Width           =   1095
   End
   Begin VB.TextBox Text4 
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   14.25
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   360
      TabIndex        =   14
      Top             =   3480
      Width           =   5295
   End
   Begin VB.TextBox Text3 
      Height          =   375
      Left            =   1440
      TabIndex        =   12
      Top             =   1680
      Width           =   1695
   End
   Begin VB.CheckBox Check2 
      Caption         =   "不要7"
      Height          =   375
      Left            =   2520
      TabIndex        =   11
      Top             =   2160
      Width           =   1095
   End
   Begin VB.CheckBox Check1 
      Caption         =   "不要4"
      Height          =   255
      Left            =   1320
      TabIndex        =   10
      Top             =   2280
      Width           =   975
   End
   Begin VB.TextBox Text2 
      Height          =   375
      Left            =   1440
      TabIndex        =   8
      Top             =   1200
      Width           =   1695
   End
   Begin VB.TextBox Text1 
      Height          =   375
      Left            =   1440
      TabIndex        =   6
      Top             =   720
      Width           =   1695
   End
   Begin VB.CommandButton readkeyboardB 
      Caption         =   "读键盘-再输入密码"
      Height          =   615
      Left            =   3720
      TabIndex        =   5
      Top             =   1320
      Width           =   2175
   End
   Begin VB.CommandButton writecard 
      Caption         =   "写磁卡&W"
      Height          =   615
      Left            =   360
      TabIndex        =   4
      Top             =   2640
      Width           =   1215
   End
   Begin VB.CommandButton readcard 
      Caption         =   "读磁卡&R"
      Height          =   615
      Left            =   4560
      TabIndex        =   3
      Top             =   2640
      Width           =   975
   End
   Begin VB.ComboBox Combo1 
      Height          =   300
      ItemData        =   "Form1.frx":0026
      Left            =   1440
      List            =   "Form1.frx":0030
      Style           =   2  'Dropdown List
      TabIndex        =   1
      Top             =   120
      Width           =   1575
   End
   Begin VB.CommandButton readkeyboardA 
      Caption         =   "读键盘-请输入密码"
      Height          =   615
      Left            =   3720
      TabIndex        =   0
      Top             =   600
      Width           =   2175
   End
   Begin VB.Label Label5 
      Caption         =   "读写轨道:"
      Height          =   255
      Left            =   3720
      TabIndex        =   16
      Top             =   120
      Width           =   975
   End
   Begin VB.Label Label4 
      Caption         =   "当前号码"
      Height          =   255
      Left            =   120
      TabIndex        =   13
      Top             =   1800
      Width           =   1095
   End
   Begin VB.Label Label3 
      Caption         =   "结束号码"
      Height          =   255
      Left            =   120
      TabIndex        =   9
      Top             =   1320
      Width           =   1095
   End
   Begin VB.Label Label2 
      Caption         =   "开始号码"
      Height          =   255
      Left            =   120
      TabIndex        =   7
      Top             =   840
      Width           =   1095
   End
   Begin VB.Label Label1 
      Caption         =   "通讯端口:"
      Height          =   255
      Left            =   360
      TabIndex        =   2
      Top             =   240
      Width           =   1095
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Text1.Text = Text3.Text
Dim strtest As String
Dim comset As String
Dim wdata, rdata As String
Dim track, ret As Integer
comset = Combo1.Text
comset = Mid(comset, 4, 1)
comset = comset & ",9600,N,8,1"
track = Combo2.ListIndex + 1

For i = Text1.Text To Text2.Text
Text3.Text = i
wdata = Trim(Text3.Text)
ret = Wcard(comset, wdata, track)
If ret = -5 Then Exit For '退出

If ret <> 1 Then Text4.Text = Str(i) + "写入失败!"

If ret = 1 Then Text4.Text = Str(i) + "写入成功!"

'Text3.Text = Text3.Text + 1
Next

End Sub

Private Sub Form_KeyPress(KeyAscii As Integer)
'If KeyAscii <> 27 Then

'End If

End Sub

Private Sub Form_Load()
Combo1.ListIndex = 0
Combo2.ListIndex = 1

Text1.Text = 80000
Text3.Text = 80000
Text2.Text = 81000
End Sub

Private Sub readcard_Click()

Dim strtest As String
Dim comset As String
Dim wdata, rdata As String
Dim track, ret As Integer
comset = Combo1.Text
comset = Mid(comset, 4, 1)
comset = comset & ",9600,N,8,1"
rdata = String(255, vbNullChar)
track = Combo2.ListIndex + 1
'MsgBox track
ret = Rcard(comset, rdata, track)
If ret <> 1 Then
MsgBox ret
End If

Text4.Text = rdata
End Sub

Private Sub readkeyboardA_Click()
Dim strtest As String
Dim comset As String
Dim wdata, rdata As String
Dim track, ret As Integer
comset = Combo1.Text
comset = Mid(comset, 4, 1)
comset = comset & ",9600,N,8,1"
rdata = String(255, vbNullChar)
ret = ReadKeyA(comset, rdata)
MsgBox rdata
End Sub

Private Sub readkeyboardB_Click()
Dim strtest As String
Dim comset As String
Dim wdata, rdata As String
Dim track, ret As Integer
comset = Combo1.Text
comset = Mid(comset, 4, 1)
comset = comset & ",9600,N,8,1"
rdata = String(255, vbNullChar)
ret = ReadKeyB(comset, rdata)
Text4.Text = rdata
End Sub

Private Sub writecard_Click()
Dim strtest As String
Dim comset As String
Dim wdata, rdata As String
Dim track, ret As Integer
comset = Combo1.Text
comset = Mid(comset, 4, 1)
comset = comset & ",9600,N,8,1"
track = Combo2.ListIndex + 1
wdata = Trim(Text3.Text)
ret = Wcard(comset, wdata, track)
If ret <> 1 Then
 Text4.Text = ret
End If
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -