<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 = strReturn
End Function
</script>
<script language="javascript">
var xmlhttp= new ActiveXObject("Msxml2.xmlhttp")
xmlhttp.open("GET","http://www.csdn.net/",false)
xmlhttp.send()
alert(bytes2BSTR(xmlhttp.ResponseBody))
</script>ASP版本的:<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 = strReturn
End FunctionDim xmlhttp
set xmlhttp=Server.CreateObject("Msxml2.xmlhttp")
xmlhttp.open "GET","http://www.csdn.net/",false
xmlhttp.send
response.write bytes2BSTR(xmlhttp.ResponseBody)
</script>C#版本的:
http://www.ccw.com.cn/htm/center/prog/02_5_9_2.aspusing System.IO;
using System.Net;
using System.Text;
在
private void button1_Click(object sender, System.EventArgs e)
{
}
byte[] buf = new byte[38192];
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(textBox1.Text);
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
Stream resStream = response.GetResponseStream();
int count = resStream.Read(buf, 0, buf.Length);
textBox2.Text = Encoding.Default.GetString(buf, 0, count);
resStream.Close();
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 = strReturn
End Function
</script>
<script language="javascript">
var xmlhttp= new ActiveXObject("Msxml2.xmlhttp")
xmlhttp.open("GET","http://www.csdn.net/",false)
xmlhttp.send()
alert(bytes2BSTR(xmlhttp.ResponseBody))
</script>ASP版本的:<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 = strReturn
End FunctionDim xmlhttp
set xmlhttp=Server.CreateObject("Msxml2.xmlhttp")
xmlhttp.open "GET","http://www.csdn.net/",false
xmlhttp.send
response.write bytes2BSTR(xmlhttp.ResponseBody)
</script>C#版本的:
http://www.ccw.com.cn/htm/center/prog/02_5_9_2.aspusing System.IO;
using System.Net;
using System.Text;
在
private void button1_Click(object sender, System.EventArgs e)
{
}
byte[] buf = new byte[38192];
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(textBox1.Text);
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
Stream resStream = response.GetResponseStream();
int count = resStream.Read(buf, 0, buf.Length);
textBox2.Text = Encoding.Default.GetString(buf, 0, count);
resStream.Close();
解决方案 »
- js设置元素坐标问题
- javascript的数组元素为对象时出现的问题
- FireFox的 Cookie存放在哪里?
- 为什么scrollHeight 在htc中是0呢?
- 请问以下代码中的函数是不是只能执行一次,下一次点击按钮的时候就直接用上次生成的结果缓冲,不再执行这个函数了?如果要想下一次点击按钮
- <script language='javascript'>window.location.href = './aaa/index.htm'</script>为什么在2000系统下不执行
- 挑战高手!我不知道JavaScript可不可以这样:在TXT文件中的每个字的后面加一个空格后再转换成HTM文件显示!!详情请进——〉
- 如何获取select里面某项的label值,而不是value
- 怎样解决空格问题?
- 如何實現不直接打開文件(文本圖片等),而由用戶下載
- 在JAVASCRIPT程序中动态设定一个控件的属性,使它变为DISABLE??
- 如何在checkbox上实现"全选"
<body onload="alert(document.body.outerHTML)">hgghjgh
<body onload="alert(document.body.outerHTML)">
<p>测试
</body>
<body onload="alert(document.body.outerHTML)">
<p>测试
</body>比较简单的,但不全面
<input type=button onclick="window.location = 'view-source:'+ window.location.href" value=看源码>