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

📄 form3.frm

📁 基于AT89C51的宾馆IC卡门锁发卡系统 包括上位机和下位机 下位机采用VB下位机为汇编语言编程
💻 FRM
📖 第 1 页 / 共 2 页
字号:
      TabIndex        =   16
      Top             =   1440
      Width           =   1095
   End
   Begin VB.Label Label8 
      Alignment       =   2  'Center
      BackStyle       =   0  'Transparent
      Caption         =   "发卡 系 统"
      BeginProperty Font 
         Name            =   "隶书"
         Size            =   21.75
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H8000000D&
      Height          =   495
      Left            =   2400
      TabIndex        =   15
      Top             =   120
      Width           =   3015
   End
   Begin VB.Label Label3 
      Alignment       =   2  'Center
      BackStyle       =   0  'Transparent
      Caption         =   "房 间 号"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   120
      TabIndex        =   14
      Top             =   1440
      Width           =   975
   End
   Begin VB.Label Label2 
      Alignment       =   2  'Center
      BackStyle       =   0  'Transparent
      Caption         =   "卡 号"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   3840
      TabIndex        =   13
      Top             =   720
      Width           =   1215
   End
   Begin VB.Label Label1 
      Alignment       =   2  'Center
      BackStyle       =   0  'Transparent
      Caption         =   "IC卡类型"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Index           =   1
      Left            =   0
      TabIndex        =   12
      Top             =   720
      Width           =   1095
   End
   Begin VB.Menu operate 
      Caption         =   "操作"
      Begin VB.Menu write 
         Caption         =   "写卡"
      End
      Begin VB.Menu read 
         Caption         =   "读卡"
      End
      Begin VB.Menu record 
         Caption         =   "记录信息"
      End
      Begin VB.Menu find 
         Caption         =   "查询"
      End
      Begin VB.Menu cancel 
         Caption         =   "删除"
      End
      Begin VB.Menu melt 
         Caption         =   "销户"
      End
   End
   Begin VB.Menu set 
      Caption         =   "设置"
      Begin VB.Menu setting 
         Caption         =   "设置波特率"
      End
   End
   Begin VB.Menu return 
      Caption         =   "返回"
   End
End
Attribute VB_Name = "Form3"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
'Timer1.Enabled = False
Form3.Command2.Enabled = True
Form3.Command3.Enabled = True
'Timer1.Enabled = True
Command1.Enabled = False
End Sub

Private Sub Command2_Click()
On Error Resume Next
Command3.Enabled = Not Command3.Enabled
'Command5.Enabled = Not Command5.Enabled
If Command2.Caption = "修 改" Then
   Command2.Caption = "确 认"
   Data1.Recordset.Edit
   Text1.SetFocus
   Command1.Enabled = True
   
   
Else
   Command2.Caption = "修 改"
   Data1.Recordset.Fields("IC卡类型") = Text1.Text
   Data1.Recordset.Fields("卡号") = Text2.Text
   Data1.Recordset.Fields("日期") = Text3.Text
   Data1.Recordset.Fields("时间") = Text4.Text
   Data1.Recordset.Fields("星期") = Text5.Text
   Data1.Recordset.Fields("房间号") = Text6.Text
   Data1.Recordset.Updata
   Data1.Recordset.MoveLast
   Data1.Refresh
End If
End Sub

Private Sub Command3_Click()
On Error Resume Next
Dim mst$, res$
mst = "您是否真的要删除?"
res = MsgBox(mst, vbOKCancel + vbExclamation)
Select Case res
Case vbOK
  Data1.Recordset.Delete
  Data1.Recordset.MoveNext
  If Data1.Recordset.EOF Then
     Data1.Recordset.MoveLast
  End If
  Data1.Refresh
End Select
End Sub

Private Sub Command4_Click()
Form4.Show
End Sub

Private Sub Command5_Click()
For i = 0 To 20000000
Next i
Command7.Enabled = Not Command7.Enabled
Command5.Enabled = Not Command5.Enabled

Dim s1$, s2$, n%, ss$, str$, str1$, str2$
MSComm1.Settings = "600,n,8,1"
     If Text1.Text = "总控卡" Then
        Text1.Text = "a"
      End If
      If Text1.Text = "楼层卡" Then
       Text1.Text = "b"
      End If
      If Text1.Text = "客户卡" Then
      Text1.Text = "c"
      End If
      If Text1.Text = "设置卡" Then
      Text1.Text = "d"
      End If
      If Text5.Text = "星期日" Then
        Text5.Text = "0"
      End If
       If Text5.Text = "星期一" Then
      Text5.Text = "1"
      End If
      If Text5.Text = "星期二" Then
       Text5.Text = "2"
      End If
      If Text5.Text = "星期三" Then
      Text5.Text = "3"
      End If
      If Text5.Text = "星期四" Then
      Text5.Text = "4"
      End If
      If Text5.Text = "星期五" Then
       Text5.Text = "5"
      End If
      If Text5.Text = "星期六" Then
      Text5.Text = "6"
      End If
X1 = Mid$(Text3.Text, 1, 4)
X2 = Mid$(Text3.Text, 6, 1)
x3 = Mid$(Text3.Text, 8, 2)
Text3.Text = X1 + X2 + x3
'If Mid$(Text4.Text, 1, 1) = 1 Then
Y1 = Mid$(Text4.Text, 1, 2)
Y2 = Mid$(Text4.Text, 4, 2)
y3 = Mid$(Text4.Text, 7, 2)
Text4.Text = Y1 + Y2 + y3
str = Text1.Text + Text2.Text + Text6.Text + Text5.Text + Text3.Text + Text4.Text
str1 = Trim(str)
Text7.Text = str1
Timer1.Enabled = True
Command7.Enabled = Not Command7.Enabled
Command5.Enabled = Not Command5.Enabled
End Sub

Private Sub Command6_Click()
a = MsgBox("确定要退出程序吗?", vbOKCancel + vbExclamation, "退出程序")
Select Case a
Case vbOK
   End
Case vbCancel
Form1.Show
 End Select
End Sub

Private Sub Command7_Click()
Dim din As Variant, buf1$, buf2$, str1$, str2$, str3$, str4$, K%, L%
Select Case MSComm1.CommEvent
  Case comEvReceive
  din = Trim(MSComm1.Input)
  Text7.Text = Text7.Text + din
End Select
End Sub
Private Sub Command8_Click()
Form3.Text1.Text = ""
Form3.Text2.Text = ""
Form3.Text3.Text = ""
Form3.Text4.Text = ""
Form3.Text5.Text = ""
Form3.Text6.Text = ""


End Sub

Private Sub Command9_Click()
Dim s1$, s2$, n%, ss$, str$, i%
Command5.Enabled = True
Command7.Enabled = True
MSComm1.Settings = "600,m,8,1"
s1 = InputBox("请输入握手信息(十六进制格式,字母大写)", "握手信息输入")
s2 = Trim(s1)
n = Len(s2)
If (n >= 1) Then
   If s2 <= "0F" Then
      ss = Mid$(s2, 2, 1)
   Else
      ss = s2
   End If
Text7.Text = s2
Command1.Enabled = True
Timer1.Enabled = True
MSComm1.Settings = "600,m,8,1"
Else
MsgBox "没有输入任何有效呼叫信息!"
Exit Sub
End If
Timer1.Enabled = True
End Sub

Private Sub Form_Load()
MSComm1.CommPort = 1
MSComm1.Settings = "600,n,8,1"
MSComm1.PortOpen = True
Command5.Enabled = False
Command7.Enabled = False
End Sub

Private Sub Text1_click()

 If Text1.Text = "a" Then
 
  Form3.Text1.Text = "总控卡"
 End If
 If Text1.Text = "b" Then
  Form3.Text1.Text = "楼层卡"
End If
If Text1.Text = "c" Then
  Form3.Text1.Text = "客户卡"
 End If
 If Text1.Text = "d" Then
  Form3.Text1.Text = "设置卡"
  End If
End Sub

Private Sub Text3_click()
Text3.Text = Date
End Sub

Private Sub Text4_click()

Text4.Text = Time
End Sub

Private Sub Text5_click()
Select Case Weekday(Now)
Case 1
w$ = "星期日"
Case 2
w$ = "星期一"
Case 3
w$ = "星期二"
Case 4
w$ = "星期三"
Case 5
w$ = "星期四"
Case 6
w$ = "星期五"
Case 7
w$ = "星期六"
End Select

Text5.Text = w$
End Sub

Private Sub Timer1_Timer()
Dim buf3$, n%
Timer1.Enabled = False
n = Len(Text7.Text)
If n >= 2 Then
   MSComm1.Output = Mid$(Text7.Text, 1, 1)
   buf3 = Mid$(Text7.Text, 2, n - 1)
   Text7.Text = ""
   Text7.Text = buf3
   ElseIf n = 1 Then
   MSComm1.Output = Mid$(Text7.Text, 1, 1)
   Text7.Text = ""
   Exit Sub
End If
Timer1.Enabled = True
End Sub

⌨️ 快捷键说明

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