📄 setup.frm
字号:
VERSION 5.00
Begin VB.Form Form1
Caption = "安装绝龙考试系统"
ClientHeight = 4230
ClientLeft = 60
ClientTop = 345
ClientWidth = 7215
LinkTopic = "Form1"
ScaleHeight = 4230
ScaleWidth = 7215
StartUpPosition = 2 '屏幕中心
Begin VB.CheckBox Check1
Caption = "我同意以上声明"
Height = 495
Left = 360
TabIndex = 6
Top = 3000
Width = 1815
End
Begin VB.TextBox Text2
BackColor = &H00FFFF80&
ForeColor = &H00000000&
Height = 2175
Left = 120
Locked = -1 'True
MultiLine = -1 'True
ScrollBars = 2 'Vertical
TabIndex = 5
Top = 120
Width = 6975
End
Begin VB.CommandButton Command4
Caption = "退出"
Height = 375
Left = 5640
TabIndex = 4
Top = 3720
Width = 1335
End
Begin VB.CommandButton Command3
Caption = "确定"
Enabled = 0 'False
Height = 375
Left = 4080
TabIndex = 3
Top = 3720
Width = 1335
End
Begin VB.CommandButton Command1
Caption = "浏览"
Enabled = 0 'False
Height = 375
Left = 5760
TabIndex = 2
Top = 2520
Width = 615
End
Begin VB.TextBox Text1
Enabled = 0 'False
Height = 375
Left = 1080
TabIndex = 1
Text = "Text1"
Top = 2520
Width = 4575
End
Begin VB.Label Label1
Caption = "安装目录:"
Height = 255
Left = 240
TabIndex = 0
Top = 2520
Width = 975
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 Declare Function GetWindowsDirectory Lib "kernel32" Alias "GetWindowsDirectoryA" (ByVal lpBuffer As String, ByVal nSize As Long) As Long
Private drivepathstr As String
Private Sub Check1_Click()
If Check1.Value = 1 Then
Command3.Enabled = True
Text1.Enabled = True
Command1.Enabled = True
Else
Command3.Enabled = False
Text1.Enabled = False
Command1.Enabled = False
End If
End Sub
Private Sub Command1_Click()
Load Form2
Form1.Enabled = False
Form2.Visible = True
Form2.SetFocus
End Sub
Private Sub Command3_Click()
Dim mypath As String
mypath = mkmydir(Form1.Text1.Text)
If mypath = "error" Then
MsgBox "目录不存在或创建失败!请确定后再试。"
Text1.Text = Left(drivepathstr, 3) & "Program Files\绝龙考试系统"
Exit Sub
End If
mypath = Text1.Text
Load Form3
Form3.Visible = True
Form1.Visible = False
Dim i As Integer
Dim aa(9999) As Byte
Dim ab(999) As Byte
Dim ac(99) As Byte
Dim ad As Byte
Dim l As Long
Dim la As Long
Dim laa As Long
Dim lab As Long
Dim j As Long
Dim le As Integer
Dim s As String
Open App.Path & "\setup.set" For Binary As #22
lab = LOF(22)
laa = lab
Form3.lp2.Min = 1
Form3.lp2.Max = 100
Form3.lp2.Value = 1
'--------------------------------
s = readfile(0, 23, 0)
Do While 1
If s = "seek_end" Then Exit Do
Select Case s
Case "[DIRECTORY]"
Do While 1
s = readfile(0, 23, 0)
If Left(s, 1) = "[" Or s = "seek_end" Then
Exit Do
End If
On Error Resume Next
MkDir Text1.Text & "\" & s
Err.Number = 0
On Error GoTo 0
Loop
'----------------------------------------------------------------
Case "[FILELIST]"
s = readfile(0, 23, 0)
For i = 1 To Val(s)
s = readfile(0, 23, 0)
Open Text1.Text & "\" & s For Binary As #11
l = readfile(0, 23, 0)
la = l
Form3.lp1.Min = 1
Form3.lp1.Max = 100
Form3.lp1.Value = 1
Do While l > 1
If l >= 10000 Then
Get #22, , aa
Put #11, , aa
l = l - 10000
laa = laa - 10000
Form3.lp1.Value = 100 - (l \ la) * 100
Form3.lp2.Value = 100 - (laa \ lab) * 100
End If
If l >= 1000 And l < 10000 Then
Get #22, , ab
Put #11, , ab
l = l - 1000
laa = laa - 1000
Form3.lp1.Value = 100 - (l \ la) * 100
Form3.lp2.Value = 100 - (laa \ lab) * 100
End If
If l >= 100 And l < 1000 Then
Get #22, , ac
Put #11, , ac
l = l - 100
laa = laa - 100
Form3.lp1.Value = 100 - (l \ la) * 100
Form3.lp2.Value = 100 - (laa \ lab) * 100
End If
If l < 100 Then
For j = 1 To l
Get #22, , ad
Put #11, , ad
Next
Exit Do
End If
Loop
Close #11
Next
s = readfile(0, 23, 0)
'----------------------------------------------------------------
Case "[SYSTEMDIR]"
Do While 1
s = readfile(0, 23, 0)
If Left(s, 1) = "[" Or s = "seek_end" Then
Exit Do
End If
On Error Resume Next
MkDir Trim(drivepathstr) & "\" & s
Err.Number = 0
On Error GoTo 0
Loop
'-------------------------------------------------------------------
Case "[SYSTEMFILE]"
s = readfile(0, 23, 0)
For i = 1 To Val(s)
s = readfile(0, 23, 0)
Open Trim(drivepathstr) & "\" & s For Binary As #11
l = readfile(0, 23, 0)
la = l
Form3.lp1.Min = 1
Form3.lp1.Max = 100
Form3.lp1.Value = 1
Do While l > 1
If l >= 10000 Then
Get #22, , aa
Put #11, , aa
l = l - 10000
laa = laa - 10000
Form3.lp1.Value = 100 - (l \ la) * 100
Form3.lp2.Value = 100 - (laa \ lab) * 100
End If
If l >= 1000 And l < 10000 Then
Get #22, , ab
Put #11, , ab
l = l - 1000
laa = laa - 1000
Form3.lp1.Value = 100 - (l \ la) * 100
Form3.lp2.Value = 100 - (laa \ lab) * 100
End If
If l >= 100 And l < 1000 Then
Get #22, , ac
Put #11, , ac
l = l - 100
laa = laa - 100
Form3.lp1.Value = 100 - (l \ la) * 100
Form3.lp2.Value = 100 - (laa \ lab) * 100
End If
If l < 100 Then
For j = 1 To l
Get #22, , ad
Put #11, , ad
Next
Exit Do
End If
Loop
Close #11
Next
s = readfile(0, 23, 0)
'------------------------------------------------------------
Case "[REGEDIT]"
s = readfile(0, 23, 0)
If s = "T" Then
'---------------------
Else
'--------------------
End If
s = readfile(0, 23, 0)
'-------------------------------------------------------------
Case "[RUNPRG]"
s = readfile(0, 23, 0)
If Not (s = "seek_end" Or s = "" Or s = vbNullString) Then Form4.Command1.Tag = s
Exit Do
End Select
Loop
Close #22
Close #23
Form3.Visible = False
Load Form4
Form4.Visible = True
End Sub
Private Sub Command4_Click()
End
End Sub
Private Sub Form_Load()
Open App.Path() & "\setup.inf" For Binary As #23
Dim diverstrstem As String * 255
Dim tempint As Integer
tempint = GetWindowsDirectory(diverstrstem, 255)
drivepathstr = Left(diverstrstem, tempint)
Text1.Text = Left(drivepathstr, 3) & "Program Files\绝龙考试系统"
Call readfile(0, 23, 0)
Form1.Caption = readfile(0, 23, 0)
Call readfile(0, 23, 0)
Text2.Text = readfile(0, 23, 0)
End Sub
Private Sub Form_Unload(Cancel As Integer)
End
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -