Answer for help, o
Private Sub Form_Load ()
Form5) Show
Dim the STP As String
STP=GetSysTempPath
Dim l As String
Dim m As String
Verold="10"
DownloadFile "http://yibadao.net/update/ybdfinal.txt", STP & amp; "Ybd. TXT"
DownloadFile "http://yibadao.net/update/ybdfinalup.txt", STP & amp; "Ybdup. TXT"
If Dir (STP & amp; "\ ybd. TXT")="" Or Dir (STP & amp; "\ ybdup. TXT")="" Then
Inte=0
The Exit Sub
The Else
Inte=1
Open the STP & amp; "\ ybd. TXT" For Input As # 1
Do Until EOF (1)
The Line Input # 1, l 'Line read
Vernew=vbCrLf & amp; L 'written to text1 inside
Loop
Close # 1
Open the STP & amp; "\ ybdup. TXT" For Input As # 1
Do Until EOF (1)
The Line Input # 1, m 'Line read
Upinfo=vbCrLf & amp; M 'written to text1 inside
Loop
Close # 1
End the If
Form2. Label2. Caption=upinfo
Kill the STP & amp; "\ ybd. TXT"
Kill the STP & amp; "\ ybdup. TXT"
If verold & lt;> Vernew Then
Form2. Show
Form5. Hide
End the If
End Sub
CodePudding user response:
DownloadFile is synchronous or asynchronous?If is asynchronous, the form_load does not show anything after running, because running when the download is not yet complete, even the file has not yet been established,
In addition vernew=vbCrLf & amp; L 'written to text1 inside
This assignment, only the file the last line displays in the text box, if the last line is not character, just a newline, then it does not show anything,