熱點推薦:
您现在的位置: 電腦知識網 >> 編程 >> .NET編程 >> 正文

ASP 獲取騰訊IP地址的接口程序代碼

2022-06-13   來源: .NET編程 

  <script type=text/javascript教程 src=http://fwqqcom/ipaddress></script>
<script type=text/javascript>
var hehe=IPData[]
var hehe=IPData[]
alert(hehe);
alert(hehe);
documentwrite(IPDatajoin( ));
</script>

  如何用ASP來存儲從上面讀取出來的數據呢
回答
復制代碼 代碼如下:
<%
function GetResStr(URLcode)
errclear
dim HttpReturnStr
Set Http=servercreateobject("MicrosoftXMLHTTP")
Httpopen "GET"URLFalse
HttpSend()
If HttpReadystate = Then
If Httpstatus= Then
ReturnStr=BytesToBstr(code)
GetResStr=ReturnStr
End If
End If
End Function
函數名:BytesToBstr
作用:轉換二進制數據為字符
參數:Body二進制數據Cset文本編碼方式
Function BytesToBstr(BodyCset)
Dim Objstream
Set Objstream = ServerCreateObject("adodbstream")
objstreamType =
objstreamMode =
objstreamOpen
objstreamWrite body
objstreamPosition =
objstreamType =
objstreamCharset =Cset
BytesToBstr = objstreamReadText
objstreamClose
set objstream = nothing
End Function
dim vUrlTempStr
vUrl="
TempStr=GetResStr(vUrl"gb")
responsewrite "您的IP為(asp教程獲取真實IP):"&split(TempStr"""")()" " &split(TempStr"""")()" "&replace(split(TempStr"""")()"市""")
%>

  ASP 獲取騰訊IP地址的接口程序代碼


From:http://tw.wingwit.com/Article/program/net/201311/14137.html
    推薦文章
    Copyright © 2005-2022 電腦知識網 Computer Knowledge   All rights reserved.