国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學院 > 開發設計 > 正文

一個socket組件及其調用方法

2019-11-18 19:19:30
字體:
來源:轉載
供稿:網友

這個socket組件是由開發jmail的那家公司作的。
很老的一個版本了。不過挺好的。我一直在用。
比較穩定。以前發現xmlhttp在win2003 server上不太好。流量大了iis容易當掉。用這個組件倒還算穩定。

    paraHost ="m.survivalescaperooms.com"      ' host
    paraPort = 80                     ' port
    paraFileUrl ="/test/test.htm"
   
    Set Socket = CreateObject("Socket.TCP")
    Socket.Host = paraHost & ":" & paraPort
    Socket.Timeout = paraTimeout
    If Err.Number <> 0 Then Err.Clear
    Socket.open
    ' timeout error = 8000ffff
    Socket.SendLine "GET " & paraFileUrl & " HTTP/1.0"
    Socket.SendLine "HOST: " & paraHost
    Socket.SendLine ""
    Socket.SendLine ""
    'Sleep 200
    Socket.WaitForDisconnect
    If Err.Number <> 0 Then
        response.write Err.Number & " -- " & Err.Description

        Err.Clear
    Else
    response.write HTTPResponse(Socket.Buffer, 1)  ' output text from  socket
    End If
    Socket.Close
    Set Socket = Nothing

 

Private Function HTTPResponse(ByVal toHTTPResponse, ByVal whichHTTPResponse)
  On Error Resume Next
  Dim HTTPResponseDelimiter
 
  HTTPResponseDelimiter = Chr(13) & Chr(10) & Chr(13) & Chr(10)
  If (InStr(1, toHTTPResponse, HTTPResponseDelimiter, vbBinaryCompare) <> 0) Then
    Select Case whichHTTPResponse
    Case 0 'Header
      HTTPResponse = Mid(toHTTPResponse, 1, (InStr(1, toHTTPResponse, HTTPResponseDelimiter, vbBinaryCompare) - 1))
    Case 1 'Body
      HTTPResponse = Mid(toHTTPResponse, (InStr(1, toHTTPResponse, HTTPResponseDelimiter, vbBinaryCompare) + Len(HTTPResponseDelimiter)), (Len(toHTTPResponse) - (InStr(1, toHTTPResponse, HTTPResponseDelimiter, vbBinaryCompare) - 1)))
    End Select
  End If

End Function


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 大足县| 平邑县| 虎林市| 白山市| 湖口县| 宝兴县| 临朐县| 屏南县| 鄂托克前旗| 阳原县| 翁源县| 渑池县| 仁怀市| 双城市| 高碑店市| 谢通门县| 莫力| 禹州市| 巴彦淖尔市| 东海县| 吉林省| 元朗区| 乃东县| 新巴尔虎右旗| 克山县| 巨鹿县| 德兴市| 延寿县| 江北区| 康马县| 都江堰市| 龙口市| 永昌县| 横山县| 永新县| 黄石市| 百色市| 若尔盖县| 五大连池市| 章丘市| 绥阳县|