亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

ASP 獲取騰訊IP地址的代碼

 更新時(shí)間:2010年04月12日 14:22:07   作者:  
ASP 獲取騰訊IP地址的代碼 用ASP來存儲,從上面讀取出來的數(shù)據(jù)。
提問:
復(fù)制代碼 代碼如下:

<script type=text/javascript src=http://fw.qq.com/ipaddress></script>
<script type=text/javascript>
var hehe1=IPData[2]
var hehe2=IPData[3]
alert(hehe1);
alert(hehe2);
document.write(IPData.join(' '));
</script>

如何用ASP來存儲,從上面讀取出來的數(shù)據(jù)呢。
回答:
復(fù)制代碼 代碼如下:

<%
function GetResStr(URL,code)
err.clear
dim Http,ReturnStr
Set Http=server.createobject("Microsoft.XMLHTTP")
Http.open "GET",URL,False
Http.Send()
If Http.Readystate =4 Then
If Http.status=200 Then
ReturnStr=BytesToBstr(http.responseBody,code)
GetResStr=ReturnStr
End If
End If
End Function

'函數(shù)名:BytesToBstr
'作用:轉(zhuǎn)換二進(jìn)制數(shù)據(jù)為字符
'參數(shù):Body-二進(jìn)制數(shù)據(jù),Cset-文本編碼方式
Function BytesToBstr(Body,Cset)
Dim Objstream
Set Objstream = Server.CreateObject("adodb.stream")
objstream.Type = 1
objstream.Mode =3
objstream.Open
objstream.Write body
objstream.Position = 0
objstream.Type = 2
objstream.Charset =Cset
BytesToBstr = objstream.ReadText
objstream.Close
set objstream = nothing
End Function

dim vUrl,TempStr
vUrl="http://fw.qq.com/ipaddress"
TempStr=GetResStr(vUrl,"gb2312")
response.write "您的IP為(asp獲取真實(shí)IP):"&split(TempStr,"""")(1)" " &split(TempStr,"""")(5)" "&replace(split(TempStr,"""")(7),"市","")
%>

相關(guān)文章

最新評論