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楼了
相关问答:
<%On Error Resume Next
Set conn=Server.CreateObject("ADODB.Connection")
conn.begintrans
conn.Open ("Driver={SQL Server};server=(local);uid=sa;database=student;pwd=")
......
我原本是学jsp的可找了一个ASP的公司!我要重新学习! 学习ASP! 希望大家推荐一本好书给我谢谢
<ASP3.0高级编程> 网上有电子版的
发现网上asp信息时最多的 比其他的都多好多
yun
找本有应用事例的A ......
由于对页面使用了伪静态
并且对ID进行了加密。
主要代码如下:
httpd.ini
RewriteRule /List-([0-9,a-z]*).html /List.asp\?ComId=$1 [N,I]
程序代码
A为加密,B为解密函数
<a href=&q ......
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来导出文件到excel,不需要office组件,如何做?谢谢!能提供个参考的网址。。
http://www.mscto.com/aspnet/2009021435632.html
楼上的,我不需要用owc,达到导出到excel的功能,并且能通过代码来自定义 ......