How to use the ASP program to read the URL and then use the program to read the results, the complete ASP program
------Solution--------------------
So it's not a hair? Knowledge has become an array and the methods are almost http://bbs.csdn.net/topics/390776429
<script runat= "Server" language= "JScript" >
function Getjson (v) {return eval (' + V + ') ');
function ToArray (a) {//json object array format string
var dic = Server.CreateObject ("Scripting.Dictionary");
for (var i = 0; i < a.length; i++) {
var obj = Server.CreateObject ("Scripting.Dictionary");
for (x in a[i]) obj. ADD (x, a[i][x]);
DiC. ADD (i, obj);
}
return dic;
}
</script>
<%
'==================================================
' generates content from the 2 data stream
'==================================================
Function bytestobstr (strbody,codebase)
Dim obj
set Obj=server.createobject ("ADODB.stream")
obj. Type=1
obj. Mode=3
obj. Open
obj. Write strbody
obj. Position=0
obj. type=2
obj. Charset=codebase
Bytestobstr=obj. ReadText
obj. Close
Set obj=nothing
End Function
function downpage (URL)
set Xhr=server. CreateObject ("Microsoft.XMLHTTP")
Xhr.open "Get", Url,false
Xhr.send
downpage=bytestobstr (xhr.responsebody, "gb2312") ' pay attention to the code of your page, it is impossible to make garbled
End Function
' s change to microsoft.xmlhttp dynamic access
' S=downpage ("http://www.xxx.com/?no=710000")
S= "{" "ResultCode" ":" "", "" Reason "": "" Return SUCCESSD "", "" Result "": [{"" id "": "" 1 "", "" Province "" "" "," "" " "": "Xi ' an", "" Area "": "" Baqiao District "", "" Address "": "" Di Zhai Zhen Nanzhai village ""},{"" id "": "" 2 "", "" Province "": "" Shaanxi Province "," "City" ":" "Xi ' an", "" "" Area "": "" Baqiao District "", "" Address "": "" Di Pancun ""}
, {"" id "": "" 3 "," "," "Province" ":" "Shaanxi Province" "," "City" ":" "Xi ' an", "" Area "": "" Baqiao District "", "" Address "": "" Di Wu Fang Village ""}, "" Error_code "" : 0} "
Set O=getjson (s)
If o.resultcode= "then"
Set Result=toarray (O.result)
For I=0 to Result.count-1
Response. Write result (i) ("Province") & "-" &result (i) ("Address") & "<br/>"
Next
Set result=nothing
End If
Set o=nothing
%>