ΪʲôWinsock1.StateÒ»Ö±ÊÇ4ÄØ
Private Sub btnsend_Click() Dim strMsg As String Dim strHost As String Dim strPath As String strHost = "www.haidu.com" strMsg = "GET " & " / HTTP/1.1" & vbCrLf strMsg = strMsg & "Accept: */*" & vbCrLf strMsg = strMsg & "Accept-Language: zh-cn" & vbCrLf strMsg = strMsg & "Accept-Encoding: gzip , deflate" & vbCrLf strMsg = strMsg & "User-Agent: " & App.Title & vbCrLf strMsg = strMsg & "Host: " & strHost & vbCrLf strMsg = strMsg & vbCrLf Winsock1.RemoteHost = strHost Winsock1.RemotePort = 80 Winsock1.LocalPort = 81 Winsock1.Connect 'MsgBox Winsock1.State Winsock1.SendData strMsgEnd Sub