DIV CSS 佈局教程網

 DIV+CSS佈局教程網 >> 網頁腳本 >> JavaScript入門知識 >> AJAX入門 >> AJAX詳解 >> asp利用Microsoft.XMLHTTP獲取頁面信息
asp利用Microsoft.XMLHTTP獲取頁面信息
編輯:AJAX詳解     

<%
      function getHTTPPage(url)
        on error resume next
        dim http
        set http=Server.createobject("Microsoft.XMLHTTP")
        Http.open "GET",url,false
        Http.send()
        if Http.readystate<>4 then
            exit function
        end if
        getHTTPPage=bytes2BSTR(Http.responseBody)
        set http=nothing
        if err.number<>0 then err.Clear 
    end function
    Function bytes2BSTR(vIn)
        dim strReturn
        dim i1,ThisCharCode,NextCharCode
        strReturn = ""
        For i1 = 1 To LenB(vIn)
            ThisCharCode = AscB(MidB(vIn,i1,1))
            If ThisCharCode < &H80 Then
                strReturn = strReturn & Chr(ThisCharCode)
            Else
                NextCharCode = AscB(MidB(vIn,i1+1,1))
                strReturn = strReturn & Chr(CLng(ThisCharCode) * &H100 + CInt(NextCharCode))
                i1 = i1 + 1
            End If
        Next
        bytes2BSTR = strReturn
    End Function
%>

XML學習教程| jQuery入門知識| AJAX入門| Dreamweaver教程| Fireworks入門知識| SEO技巧| SEO優化集錦|
Copyright © DIV+CSS佈局教程網 All Rights Reserved