[讨论] 在load form1 时,系统读取文件到内存(这时需要一定的时间),出现进度条来
在load form1 时,系统读取文件到内存(这时需要一定的时间),出现进度条来显示读取文件的进度!不知道如何解决。!下面是读取文件的代码。在读取文件是 出现进度条(其进度条的时间如何获得) 高手指教。
Private Sub Form_Load()
i = 1
'‘================读取以前的抽奖
Dim inputdata As String * 1
On Error GoTo en
Open App.Path & "\choujiang" & "\i.txt" For Input As #1
Do While Not EOF(1)
Input #1, i
Loop
i = Val(Trim(i)) 'trim 将text2中去掉2边的空格 ,val(数字字符串转换为数值)
Close #1
Open App.Path & "\choujiang" & "\q.txt" For Input As #1
Do While Not EOF(1)
Input #1, fuzhi
q(k4 + 1) = fuzhi
k4 = k4 + 1
Loop
Close #1
fuzhi = Null
Open App.Path & "\choujiang" & "\a.txt" For Input As #1
Do While Not EOF(1)
Input #1, fuzhi
a(k3 + 1) = fuzhi
k3 = k3 + 1
Loop
Close #1
Open App.Path & "\choujiang" & "\b.txt" For Input As #1
Text4 = ""
Do While Not EOF(1)
inputdata = Input(1, #1)
Text2 = Text2 + inputdata
Loop
Dim k2 As Integer
For k2 = 1 To i - 1
b(k2) = Trim(Left(Text2, InStr((Text2), ",") - 1))
Text2 = Mid(Text2, InStr(Text2, ",") + 1)
Next k2
Close #1
Dim k As Integer
Text1 = ""
For k = 1 To i - 1
Text1 = b(k) & vbCrLf & Text1
Next k
en: End Sub