VERSION 5.00
Begin VB.Form Form1
Caption = "输入准考号"
ClientHeight = 3015
ClientLeft = 5370
ClientTop = 2985
ClientWidth = 4905
LinkTopic = "Form1"
ScaleHeight = 3015
ScaleWidth = 4905
StartUpPosition = 2 '屏幕中心
Begin VB.Timer Timer1
Enabled = 0 'False
Interval = 1000
Left = 4440
Top = 2160
End
Begin VB.CommandButton Command2
Caption = "退出"
Height = 375
Left = 2160
TabIndex = 7
Top = 2400
Width = 1215
End
Begin VB.CommandButton Command1
Caption = "确定"
Enabled = 0 'False
Height = 375
Left = 360
TabIndex = 6
Top = 2400
Width = 1095
End
Begin VB.TextBox Text3
Enabled = 0 'False
Height = 375
Left = 1320
TabIndex = 5
Top = 1560
Width = 2415
End
Begin VB.TextBox Text2
Height = 375
Left = 1320
MaxLength = 12
TabIndex = 3
Top = 960
Width = 2415
End
Begin VB.TextBox Text1
Height = 375
Left = 1320
MaxLength = 12
TabIndex = 1
Top = 480
Width = 2415
End
Begin VB.Label Label3
Caption = "考生姓名: "
Height = 375
Left = 120
TabIndex = 4
Top = 1680
Width = 1095
End
Begin VB.Label Label2
Caption = "确认准考号:"
Height = 375
Left = 120
TabIndex = 2
Top = 1080
Width = 1215
End
Begin VB.Label Label1
Caption = "输入准考号:"
Height = 375
Left = 120
TabIndex = 0
Top = 480
Width = 1215
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub Command1_Click()
On Error Resume Next
MkDir App.Path & "\student\" & Text1.Text
If Err.Number = 0 Then
On Error GoTo 0
MkDir App.Path & "\student\" & Text1.Text & "\data"
Else
kaonull = 1
On Error GoTo 0
Err.Number = 0
End If
Form1.Visible = False
Form3.Visible = True
Timer1.Enabled = True
End Sub
Private Sub Command2_Click()
start.Winsock1.Close
End
End Sub
Private Sub Form_Unload(Cancel As Integer)
End
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
If Text1.Text = Text2.Text Then
start.Winsock1.SendData "username" & Text1.Text
Else
Text2.SetFocus
End If
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 Then
If Text1.Text = Text2.Text Then
start.Winsock1.SendData "username" & Text1.Text
End If
End If
End Sub
Private Sub Timer1_Timer()
start.Winsock1.SendData "get_data"
Timer1.Enabled = False
End Sub