Ê×Ò³ Ê«´Ê ×Öµä °å±¨ ¾ä×Ó ÃûÑÔ ÓÑ´ð ÀøÖ¾ ѧУ ÍøÕ¾µØͼ
µ±Ç°Î»ÖÃ: Ê×Ò³ > ½Ì³ÌƵµÀ > ¿ª·¢ÓïÑÔ > VB >

ΪʲôWinsock1.StateÒ»Ö±ÊÇ4ÄØ,¸ÃÔõô´¦Àí

2012-01-31 
ΪʲôWinsock1.StateÒ»Ö±ÊÇ4ÄØVB codePrivate Sub btnsend_Click()Dim strMsgAs StringDim strHostAs Str

ΪʲôWinsock1.StateÒ»Ö±ÊÇ4ÄØ

VB code
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


Ë­ÄÜ°ïÎÒ¿´¿´µ½µ×Õâ¶Î´úÂëÄÄÀïÓÐÎÊÌâ°¡

[½â¾ö°ì·¨]
sckResolvingHost 4 ʶ±ðÖ÷»ú £¬Ò²¾ÍÊÇ˵ËüÒ»Ö±ÔÚ²éÕÒ·þÎñÆ÷¡£

[½â¾ö°ì·¨]
strHost = "www.haidu.com"
www.baidu.com»¹ÊÇwww.haidu.com
Ò»¸öÊÇB£¬Ò»¸öÊÇH

ÈȵãÅÅÐÐ