日期:2014-05-17  浏览次数:20966 次

页面取值,应该很简单
http://www.china-sms.com/send/readsms.asp?name=123&pwd=123
这个是浏览器地址
id=21938716&err=成功&src=134584771212&msg=你好&dst=6262002640591264&time=200705171429
这个是页面的内容。
我的问题是:
1   页面内容是怎么返回的?怎样将页面的内容存入本地库中?
2   request.querystring()应该是取页面?之后的值呀,但这个页面没有

------解决方案--------------------
/readsms.asp?name=123&pwd=123

name 是变量的名称。等号后面是变量的值

然后在另一个页面
dim aaa
aaa = request.querystring( "name ")
然后把aaa 插入数据库 就OK 了~~
------解决方案--------------------
dim id,err,src,msg,dst,time
id = request.querystring( "id ")
id = request.querystring( "err ")
id = request.querystring( "src ")
id = request.querystring( "msg ")
id = request.querystring( "dst ")
id = request.querystring( "time ")

这就能取到你那些所谓的值了
------解决方案--------------------
function getHTTPPage(turl)
dim myhttp
set myhttp=server.createobject( "MSXML2.XMLHTTP ")
myhttp.open "GET ",turl,false
myhttp.send()
if myhttp.readystate <> 4 then
exit function
end if
getHTTPPage=bytesToBSTR(myhttp.responseBody, "GB2312 ")
set myhttp=nothing
if err.number <> 0 then err.Clear
end function

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 str, arr, l, arr2
str=getHTTPPage( "http://www.china-sms.com/send/readsms.asp?name=123&pwd=123 ")
arr = split(str, "& ")
l = ubound(arr)
for i = 0 to l
arr2 = split(arr(i), "= ")
Response.write arr2(0) & ": " & arr2(1)
next