Xml|xml
Get a remote file
Response.Write Gethttppage ("Http://www.csdn.net")
function gethttppage (URL)
On Error Resume Next
Dim http
Set Http=server.createobject ("Msxml2.xmlhttp")
Http.open "Get", Url,false
Http.send ()
If Http.readystate<>4 then Exit function
Gethttppage=bytes2bstr (Http.responsebody)
Set http=nothing
If Err.number<>0 then err. Clear
End Function
Function Bytes2bstr (vIn)
Dim Strreturn
Dim I,thischarcode,nextcharcode
Strreturn = ""
For i = 1 to LenB (vIn)
Thischarcode = AscB (MidB (vin,i,1))
If Thischarcode < &h80 Then
Strreturn = Strreturn & Chr (Thischarcode)
Else
Nextcharcode = AscB (MidB (vin,i+1,1))
Strreturn = Strreturn & Chr (CLng (thischarcode) * &h100 + CInt (nextcharcode))
i = i + 1
End If
Next
Bytes2bstr = Strreturn
End Function
--------------------------------------------------------------------
Get Remote HTML file source
<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 ">
<meta name= "generator" content= "Microsoft FrontPage 5.0" >
<meta name= "ProgId" content= "FrontPage.Editor.Document" >
<body>
<div id= "Demo" > <div style= "width:677; Height:70 ">
</body>
<script language=vbscript>
Sub B3_onclick
Dim objXmlHttp, XML
Set xml = CreateObject ("Microsoft.XMLHTTP")
Xml. Open "Get", "http://192.168.8.15:7001/wap_manage/login.asp", False
' Pull the data from the Web page
Xml. Send
' Demo.innerhtml= Xml.responsetext
' Demo.innertext= Xml.responsetext
demo.innertext= Bytes2bstr (Xml.responsebody)
Set xml = Nothing
End Sub
Sub D1_select
End Sub
Function Bytes2bstr (vIn)
Dim Strreturn
Dim I, Thischarcode, Nextcharcode
Strreturn = ""
For I = 1 to LenB (vIn)
Thischarcode = AscB (MidB (VIn, I, 1))
If Thischarcode < &h80 Then
Strreturn = Strreturn & Chr (Thischarcode)
Else
Nextcharcode = AscB (MidB (vIn, I + 1, 1))
Strreturn = Strreturn & Chr (CLng (thischarcode) * &h100 + CInt (nextcharcode))
i = i + 1
End If
Next
Bytes2bstr = Strreturn
End Function
</script>
<input type= "button" value= "Get HTML Source" name= "B3" >