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

📄 form1.frm

📁 写卡器的串口测试程序, 有delphi的,vb的... 涉用到好几有语言, 还包括说明
💻 FRM
字号:
VERSION 5.00
Begin VB.Form Form1 
   Caption         =   "ghc715.dll测试程序(VB)"
   ClientHeight    =   4035
   ClientLeft      =   60
   ClientTop       =   360
   ClientWidth     =   7140
   ClipControls    =   0   'False
   LinkTopic       =   "Form1"
   ScaleHeight     =   4035
   ScaleWidth      =   7140
   StartUpPosition =   2  'CenterScreen
   Begin VB.CommandButton cmdExit 
      Caption         =   "退出"
      Height          =   375
      Left            =   4560
      TabIndex        =   12
      Top             =   3240
      Width           =   975
   End
   Begin VB.CommandButton cmdOK 
      Caption         =   "执行"
      Height          =   375
      Left            =   1440
      TabIndex        =   11
      Top             =   3240
      Width           =   975
   End
   Begin VB.TextBox sTwo 
      Height          =   375
      Left            =   1800
      TabIndex        =   10
      Top             =   2400
      Width           =   4815
   End
   Begin VB.TextBox sOneThree 
      Height          =   375
      Left            =   1800
      TabIndex        =   9
      Top             =   1920
      Width           =   4815
   End
   Begin VB.Frame Frame2 
      Caption         =   "提示"
      Height          =   975
      Left            =   2520
      TabIndex        =   5
      Top             =   360
      Width           =   4095
      Begin VB.Label Label2 
         Caption         =   "磁条读写器读写DLL说明:相应DLL文件ghc715.dll应在当前目录。"
         Height          =   615
         Left            =   240
         TabIndex        =   6
         Top             =   240
         Width           =   3735
      End
   End
   Begin VB.TextBox nTrack 
      Height          =   375
      Left            =   1800
      TabIndex        =   4
      Top             =   1440
      Width           =   4815
   End
   Begin VB.OptionButton optRead 
      Caption         =   "读"
      Height          =   375
      Left            =   720
      TabIndex        =   1
      Top             =   720
      Width           =   495
   End
   Begin VB.Frame Frame1 
      Caption         =   "读/写"
      Height          =   975
      Left            =   480
      TabIndex        =   2
      Top             =   360
      Width           =   1935
      Begin VB.OptionButton optWrite 
         Caption         =   "写"
         Height          =   375
         Left            =   1080
         TabIndex        =   3
         Top             =   360
         Width           =   735
      End
   End
   Begin VB.Label Label4 
      Caption         =   "数据(2道):"
      Height          =   255
      Left            =   360
      TabIndex        =   8
      Top             =   2520
      Width           =   1335
   End
   Begin VB.Label Label3 
      Caption         =   "数据(1/3道):"
      Height          =   255
      Left            =   360
      TabIndex        =   7
      Top             =   2040
      Width           =   1695
   End
   Begin VB.Label Label1 
      Caption         =   "磁道参数(1-5):"
      Height          =   255
      Left            =   360
      TabIndex        =   0
      Top             =   1560
      Width           =   1215
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False

Private Sub cmdExit_Click()

    End
    
End Sub

Private Sub cmdOK_Click()
    Dim s1 As String
    Dim s2 As String
    Dim n   As Long
    Dim err As Long
    
    
    n = Val(nTrack.Text)
    If (n < 1) Or (n > 5) Then
        MsgBox "You must enter an integer between 1 and 5!"
        nTrack.Text = ""
        nTrack.SetFocus
        Exit Sub
    End If
    
    If optWrite.Value = True Then
        
        
        s1 = Trim(sTwo.Text) + Chr(0)
        s2 = Trim(sOneThree.Text) + Chr(0)
        err = writecard(1, n, s1, s2, 1)
        If err = 0 Then
            MsgBox "succeed in writing !"
        Else
            MsgBox "failed in writing ="
        End If
    Else
        s1 = String(255, Chr(0))
        s2 = String(255, Chr(0))
        err = readcard(1, n, s1, s2, 1)
        If err = 0 Then
            MsgBox "succeed in reading !"
            sOneThree.Text = Trim(s2)
            sTwo.Text = Trim(s1)
        Else
            MsgBox "failed in reading"
        End If
    End If
    
End Sub

Private Sub optRead_Click()
    If optWrite.Value = True Then
        optWrite.Value = False
        optRead.Value = True
    End If
    sOneThree.Text = ""
    sTwo = ""
End Sub

Private Sub optWrite_Click()
    If optRead.Value = True Then
        optRead.Value = False
        optWrite.Value = True
    End If
End Sub

⌨️ 快捷键说明

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