ASP访问远程XML错误:文档必须有一个顶层元素
VBScript code:
Set http=Server.CreateObject("MSXML2.ServerXMLHTTP")
http.Open "post","http://www.yodao.com/smartresult-xml/search.s?type=ip&q=221.123.123.123",false
http.send
Set xml = Server.CreateObject("Microsoft.XMLDOM")
xml.Async = false
xml.ValidateOnParse = true
xml.setProperty "ServerHTTPRequest",true
xml.load(http.ResponseXML)
if xml.ParseError.errorCode<>0 then
Response.Write("Error: " & xml.parseError.reason & "<br>")
Response.Write("Code: 0x" & hex(xml.parseError.errorCode) & "<br>")
Response.Write("At Line: " & xml.parseError.line & "<br>")
Response.Write("At pos: " & xml.parseError.linePos & "<br>")
else
set objRootElement = xml.documentElement
Response.Write objRootElement.childnodes(0).text
end if
这段代码挺好,简单易懂。顶
太感谢2楼了
相关问答:
我有一个asp源码,但是出现一个文件,我用asp解密都是乱码
请教
VBScript code:
??
%# , #&')*)-0-(0%()(?
(((((((((((((((((((((((((( ......
我原本是学jsp的可找了一个ASP的公司!我要重新学习! 学习ASP! 希望大家推荐一本好书给我谢谢
<ASP3.0高级编程> 网上有电子版的
发现网上asp信息时最多的 比其他的都多好多
yun
找本有应用事例的A ......
Function listPages(LinkFile)
if not (rs.eof and rs.bof) then
gopage=currentpage
totalpage=n
blockPage=Int((gopage-1)/10)*10+1
If LCase(Request.ServerVariables("HT ......
我在asp页面做了一个从1开始往上累加的东西,为什么每次点击按钮时数值都不往上加。
不知道什么原因,请教高手!
看看你的代码啊
int a=0;
a++;
txtBox.text=a.toString();
......
这个程序是读大一时学C语言我自己想出的,老师直夸我聪明,现在用ASP改写了,大家知道运行结果吗
<table width="486" border="1" cellpadding="0" cellspacing="1"& ......