2.Get HTTP File '我还不知道在ASP里面怎么用,有知道的请指点。 Dim b() As Byte b() = objInet.OpenURL(strURL, icByteArray) If UBound(b) < 1 Then strErrorMsg = "无法打开该URL地址!" Else Open FileName For Binary Access Write As #1 Put #1, , b() Close #1 End If
4.List FTP Files objInet.URL = "ftp://ftp.pku.edu.cn" objInet.Execute , "DIR /dir1" Private Sub objInet_StateChanged(ByVal State As Integer) '因为Execute方法执行后并不是马上返回结果的,所以必须在StateChanged事件中处理 Dim vtData As Variant '数据变量。 Dim strData As String: strData = "" Dim bDone As Boolean: bDone = False If State = 12 Then vtData = objInet.GetChunk(1024, icString) DoEvents Do While Not bDone strData = strData & vtData DoEvents vtData = objInet.GetChunk(1024, icString) If Len(vtData) = 0 Then bDone = True End If Loop End If MsgBox(strData) End Sub
5.Use Proxy Server objInet.Proxy = "proxy.io.com:3128" objInet.AccessType = icNamedProxy
6.Use HTTP Get & Post objInet.Execute "http://www.chinaasp.com/sqlbbs/wwwboard.asp", "GET", "id=1" 要用Post只需要把GET那几个字符换一下就可以了,取得返回值的方法同4