人人做人人澡人人爽欧美,国产主播一区二区,久久久精品五月天,羞羞视频在线观看免费

當前位置:蘿卜系統下載站 > 技術開發教程 > 詳細頁面

一個socket組件及其調用辦法

一個socket組件及其調用辦法

更新時間:2022-08-16 文章作者:未知 信息來源:網絡 閱讀次數:

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

    paraHost ="www.knowsky.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

溫馨提示:喜歡本站的話,請收藏一下本站!

本類教程下載

系統下載排行

網站地圖xml | 網站地圖html
主站蜘蛛池模板: 石渠县| 宁海县| 项城市| 屯昌县| 清徐县| 新建县| 安丘市| 垫江县| 绥江县| 都安| 平罗县| 绿春县| 资兴市| 文成县| 沙坪坝区| 沁阳市| 湘潭市| 呼图壁县| 尉犁县| 宁乡县| 康保县| 穆棱市| 聂荣县| 建昌县| 获嘉县| 会宁县| 将乐县| 潞西市| 海原县| 辽源市| 上杭县| 胶州市| 灵川县| 阳朔县| 合水县| 南召县| 德安县| 松阳县| 永靖县| 霍山县| 乾安县|