www.pudn.com > xj1.rar > Module1.bas, change:2008-05-31,size:1879b


Attribute VB_Name = "Module1" 
'定义填考生信息变量各项长度 
Type people 
xingming As String * 10 
xuehao As String * 6 
zhunkaozheng As String * 10 
password As String * 16 
sex As String * 2 
age As String * 2 
score As String * 2 
End Type 
 
 
'定义选择题目自定义型变量各项长度 
Type Xuezhe 
Question As String * 40 
a As String * 20 
B As String * 20 
C As String * 20 
D As String * 20 
Answer As String * 1 
End Type 
'定义填空题目自定义型变量各项长度 
Type tiaokong 
Question1 As String * 60 
answer1 As String * 20 
End Type 
 
 Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long 
 Const SW_SHOWNORMAL = 1 
'调用浏览器打开使用说明 
Sub shoum1() 
Dim Result 
Result = ShellExecute(0, vbNullString, "data\使用说明.html", vbNullString, vbNullString, SW_SHOWNORMAL) 
If Result <= 32 Then 
MsgBox "调用浏览器错误!", vbOKOnly + vbCritical, "错误:", 0 
End If 
End Sub 
'用记事本打开所有源代码 
 Sub duma() 
 Shell "c:\windows\system32\notepad.exe " & App.Path & "\data\源代码.txt", vbNormalFocus 
 End Sub 
'计算结束时间 
Function addtime(ByVal startime As Date, ByVal hours As Integer) As Date 
addtime = Format(TimeSerial(Hour(startime) + hours, Minute(startime), Second(startime)), "hh:mm:ss") 
 End Function 
'调用记事打开使用说明 
Sub shuom() 
 Shell "c:\windows\system32\notepad.exe " & App.Path & "\data\使用说明.txt", vbNormalFocus 
 End Sub 
Sub dudaima() 
'读取代码过程 
Form7.Label1.Caption = "代码加载中..." 
Form7.Text1.Visible = False 
Open Form7.Label2.Caption For Input As #1 
Do While Not EOF(1) 
Line Input #1, buf 
Form7.Text1.Text = Form7.Text1.Text + Chr(13) + Chr(10) + buf 
Loop 
Form7.Label1.Caption = "当前窗体代码" 
Form7.Text1.Visible = True 
Close #1 
End Sub