1,502
社区成员
发帖
与我相关
我的任务
分享
Private Sub Form_Load()
Winsock1.RemoteHost = "www.xxxx.com"
Winsock1.RemotePort = 80
Winsock1.Connect
End Sub
Private Sub Winsock1_Connect()
Dim Cmd As String
Dim Url As String
Url = "http://www.xxxx.com/Base.aspx"
Cmd = "GET " + Url + " HTTP/1.1" & vbCrLf & vbCrLf
Winsock1.SendData Cmd
End Sub
Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long)
Dim Text
Winsock1.GetData Text, vbString
Text1.Text = Text1.Text & Text
End Sub
dim s as string
s=WebBrowser.Document.body.innerHTML或者innerText
dim s as string
s=Inet.OpenURL("http://www.86lg.com")
Private Sub Command1_Click()
Dim Http As Object, URL As String, WebCode As String
Set Http = CreateObject("Microsoft.XMLHTTP") '调用XMLHTTP对象
URL = "http://www.86lg.com" '赋予变量URL值
Http.open "get", URL, False '定义打开URL方式
Http.send '发送数据
WebCode = TRAN(Http.responsebody) '变量zhi等于网页内容
End Sub
Function TRAN(vIn) As String
Dim strReturn As String, ThisCharCode As String, NextCharCode As String
Dim i As Long
strReturn = ""
For i = 1 To LenB(vIn)
ThisCharCode = AscB(MidB(vIn, i, 1))
If ThisCharCode < &H80 Then
strReturn = strReturn & Chr(ThisCharCode)
Else
NextCharCode = AscB(MidB(vIn, i + 1, 1))
strReturn = strReturn & Chr(CLng(ThisCharCode) * &H100 + CInt(NextCharCode))
i = i + 1
End If
Next
TRAN = strReturn
End Function