因为网站力量不够,需要从兄弟网站自动获取各栏目信息,需要对方提供是么信息,本地需要怎么做?

解决方案 »

  1.   

    '用法 call winsockdown
    Const host1 = "www.baidu.com"
    Const Url1 = "/"
    Dim sockdgetdata As StringFunction winsockdown()
    Winsock1.RemoteHost = host1 '"www.xcinfo.ha.cn" '"nease.com"
    Winsock1.RemotePort = 80
    Winsock1.Connect
    End Function
    Private Sub Winsock1_Connect()
    Dim strCommand As String
    strCommand = "GET " + Url1 + " HTTP/1.0" + vbCrLf
    strCommand = strCommand + "Accept: */*" + vbCrLf
    strCommand = strCommand + "Accept: text/html" + vbCrLf
    strCommand = strCommand + vbCrLf
    Winsock1.SendData strCommand
    End Sub
    Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long)
    Dim webData As String
    Winsock1.GetData webData, vbString
    RichTextBox1.Text = RichTextBox1.Text & webData
    sockdgetdata = sockdgetdata + webData
    End SubPrivate Sub Winsock1_Close()
    Winsock1.Close
    MsgBox sockdgetdata
    End Sub
      

  2.   


    "GET / HTTP/1.0\r\nAccept: */*\r\nAccept: text/html\r\n";