?? 二考加時.frm
字號:
VERSION 5.00
Begin VB.Form Form2
Caption = "二考加時"
ClientHeight = 3195
ClientLeft = 60
ClientTop = 345
ClientWidth = 4680
LinkTopic = "Form2"
ScaleHeight = 3195
ScaleWidth = 4680
StartUpPosition = 1 '所有者中心
Begin VB.TextBox Text5
Height = 270
Left = 1320
TabIndex = 11
Top = 1560
Width = 1815
End
Begin VB.TextBox Text4
Height = 270
Left = 1320
TabIndex = 9
Top = 1200
Width = 1815
End
Begin VB.TextBox Text3
Height = 270
Left = 1320
TabIndex = 8
Top = 840
Width = 1815
End
Begin VB.TextBox Text2
Height = 270
Left = 1320
MaxLength = 12
TabIndex = 7
Top = 480
Width = 1815
End
Begin VB.TextBox Text1
Height = 270
Left = 1320
MaxLength = 12
TabIndex = 6
Top = 120
Width = 1815
End
Begin VB.CommandButton Command2
Caption = "退出加時"
Height = 495
Left = 2520
TabIndex = 5
Top = 2520
Width = 1095
End
Begin VB.CommandButton Command1
Caption = "確定"
Enabled = 0 'False
Height = 495
Left = 360
TabIndex = 4
Top = 2520
Width = 1095
End
Begin VB.Label Label7
Caption = "分鐘"
Height = 255
Left = 3240
TabIndex = 13
Top = 1560
Width = 495
End
Begin VB.Label Label6
Caption = "共有時間:"
Height = 255
Left = 240
TabIndex = 12
Top = 1920
Width = 2895
End
Begin VB.Label Label5
Caption = "所加時間:"
Height = 255
Left = 240
TabIndex = 10
Top = 1560
Width = 975
End
Begin VB.Label Label4
Caption = "余下時間:"
Height = 255
Left = 240
TabIndex = 3
Top = 1200
Width = 975
End
Begin VB.Label Label3
Caption = "考生姓名:"
Height = 255
Left = 240
TabIndex = 2
Top = 840
Width = 975
End
Begin VB.Label Label2
Caption = "確認考號:"
Height = 255
Left = 240
TabIndex = 1
Top = 480
Width = 975
End
Begin VB.Label Label1
Caption = "準考證號:"
Height = 255
Left = 240
TabIndex = 0
Top = 120
Width = 975
End
End
Attribute VB_Name = "Form2"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub Command1_Click()
If Me.Caption = "二考加時" Then
Open App.Path & "\useridb.dat" For Binary As #5
bytemp = addtime(Text1.Text, 5, Text5.Text)
Print #3, "服務器:二考加時" & form3.Text1.Text & "對"; Text1.Text & "加" & Text5.Text & " " & Date & Time & Chr(16) & Chr(17)
MsgBox "加時成功!"
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Label6.Caption = "共有時間:"
Command1.Enabled = False
Else
Open App.Path & "\useridb.dat" For Append As #5
Print #5, Text1.Text & Chr(16) & Chr(17)
Print #5, Text3.Text & Chr(16) & Chr(17)
Print #5, Text4.Text & Chr(16) & Chr(17)
Close #5
Print #3, "服務器:二考加入" & form3.Text1.Text & "對"; Text1.Text & "加入二考名單" & Date & Time & Chr(16) & Chr(17)
MsgBox "加入成功!"
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Command1.Enabled = False
End If
End Sub
Private Sub Command2_Click()
Form1.Visible = True
Form1.Command5.Enabled = True
Form1.Command6.Enabled = True
Form1.Command10.Enabled = True
Form1.Command11.Enabled = True
Form1.addfen.Enabled = True
Form1.runfen.Enabled = True
Form1.lookfen.Enabled = True
Form1.twostud.Enabled = True
Form1.SetFocus
Unload Me
End Sub
Private Sub Form_Unload(Cancel As Integer)
Form1.Visible = True
Form1.Command5.Enabled = True
Form1.Command6.Enabled = True
Form1.Command10.Enabled = True
Form1.Command11.Enabled = True
Form1.SetFocus
End Sub
Private Sub Text1_KeyUp(KeyCode As Integer, Shift As Integer)
If Text1.Text = "" Or Text1.Text = vbNullString Then Exit Sub
If Right(Text1.Text, 1) > "9" Or Right(Text1.Text, 1) < "0" Then
Text1.Text = Left(Text1.Text, Len(Text1.Text) - 1)
Text1.SelStart = Len(Text1.Text)
Exit Sub
End If
If Len(Text1.Text) = 12 Then
Text2.SetFocus
End If
End Sub
Private Sub Text2_KeyUp(KeyCode As Integer, Shift As Integer)
If Text2.Text = "" Or Text2.Text = vbNullString Then Exit Sub
If Right(Text2.Text, 1) > "9" Or Right(Text2.Text, 1) < "0" Then
Text2.Text = Left(Text2.Text, Len(Text2.Text) - 1)
Text2.SelStart = Len(Text2.Text)
Exit Sub
End If
If Len(Text2.Text) = 12 And Text1.Text = Text2.Text Then
Dim usenam, usefen As String
If Me.Caption = "二考加時" Then
Open App.Path & "\useridb.dat" For Binary As #5
usenam = findadd(5, Text1.Text, usefen)
If usenam = "nullname" Then
MsgBox "準考證號錯誤!"
Text1.Text = ""
Text2.Text = ""
Text1.SetFocus
Else
Text3.Text = usenam
Text4.Text = usefen
Text5.SetFocus
Command1.Enabled = True
End If
Else
Open App.Path & "\userid.dat" For Binary As #5
usenam = findadd(5, Text1.Text, usefen)
If usenam = "nullname" Then
MsgBox "準考證號錯誤!"
Text1.Text = ""
Text2.Text = ""
Text1.SetFocus
Else
Text3.Text = usenam
Text4.Text = usefen
Command1.Enabled = True
Command1.SetFocus
End If
End If
End If
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -