那你还是去看看孟子斑竹的例子吧: <script language="vbscript"> Function bytes2BSTR(vIn) Dim strReturn,i,ThisCharCode,innerCode,Hight8,Low8,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 = strReturnEnd Function </script> <script language="javascript"> var xmlhttp=new ActiveXObject("Msxml2.xmlhttp") xmlhttp.open("GET",window.location.href,false) xmlhttp.send() var str = bytes2BSTR(xmlhttp.ResponseBody) alert(str) </script>作者:net_lover(孟子E章)
那你还是去看看孟子斑竹的例子吧: <script language="vbscript"> Function bytes2BSTR(vIn) Dim strReturn,i,ThisCharCode,innerCode,Hight8,Low8,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 = strReturnEnd Function </script> <script language="javascript"> var xmlhttp=new ActiveXObject("Msxml2.xmlhttp") xmlhttp.open("GET",window.location.href,false) xmlhttp.send() var str = bytes2BSTR(xmlhttp.ResponseBody) alert(str) </script>作者:net_lover(孟子E章)
<script language="vbscript">
Function bytes2BSTR(vIn) Dim strReturn,i,ThisCharCode,innerCode,Hight8,Low8,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 = strReturnEnd Function
</script>
<script language="javascript">
var xmlhttp=new ActiveXObject("Msxml2.xmlhttp")
xmlhttp.open("GET",window.location.href,false)
xmlhttp.send()
var str = bytes2BSTR(xmlhttp.ResponseBody)
alert(str)
</script>作者:net_lover(孟子E章)
<script language="vbscript">
Function bytes2BSTR(vIn) Dim strReturn,i,ThisCharCode,innerCode,Hight8,Low8,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 = strReturnEnd Function
</script>
<script language="javascript">
var xmlhttp=new ActiveXObject("Msxml2.xmlhttp")
xmlhttp.open("GET",window.location.href,false)
xmlhttp.send()
var str = bytes2BSTR(xmlhttp.ResponseBody)
alert(str)
</script>作者:net_lover(孟子E章)
这是读取网页代码
<form onSubmit="Readcontent();return false">
<input id="dataInput" type="text" value="http://www.csdn.net/" style="width:400px;padding-left:8px" name="text" />
<br />
<input type="submit" value="读取文件内容" name="submit" />
</form>
<h3>文件内容:</h3>
<div><b>状态:</b> <span id="dataStatus">等待输入</span></div>
<div id="dataContent" style="display:none" class="infobox"> </div>
<object id="dataObject" type="text/html" data="empty.html" style="width:1px;left:-10000px">
</object>
<script type="text/javascript">
var ref = document.getElementById("dataObject").object;
var oldContent, sProp;function Readcontent(){
dataContent.innerHTML = "";
var sURL = document.getElementById("dataInput").value;
sProp = (sURL.toLowerCase().indexOf("http")==0) ? "innerHTML" : "innerText";
var dEL = ref.body || ref.documentElement;
oldContent = dEL[ sProp ] = "";
dataStatus.innerText = "Loading file";
ref.location.href = sURL;
cInt = setInterval("Showcontent()",50);
}
function Showcontent(){
var dEL = ref.body || ref.documentElement;
var rC = dEL[ sProp ];
if(rC!=oldContent){
dataStatus.innerText = "Retrieved content";
if(self.cInt) clearInterval(cInt);
dataContent.style.display = "block";
return dataContent.innerText = rC;
}
}
</script>