加入收藏 | 设为首页 | 会员中心 | 我要投稿 聊城站长网 (https://www.0635zz.com/)- 智能语音交互、行业智能、AI应用、云计算、5G!
当前位置: 首页 > 站长学院 > Asp教程 > 正文

asp生成百度的xml代码介绍

发布时间:2023-08-30 14:32:03 所属栏目:Asp教程 来源:
导读:<%

nowtime=nowtime&"<updatetime>"&now()&"</updatetime>"&vbcrlf&""

&#39;hour(now())

&#39;minute(now())

&#39;second(now())

set rshot=server.CreateObject("a
<%
 
nowtime=nowtime&"<updatetime>"&now()&"</updatetime>"&vbcrlf&""
 
'hour(now())
 
'minute(now())
 
'second(now())
 
set rshot=server.CreateObject("adodb.recordset")
 
sql="select * from 表名 order by id asc"
 
rshot.open sql,conn,1,1
 
if not (rshot.eof and rshot.bof) then
 
i=0
 
do while not rshot.eof
 
b=b&"<item>"&vbcrlf&""
 
b=b&"<link>http://www.mycodes.net/html/"&rshot("Classid")&"/"&rshot("ID")&".html</link>"&vbcrlf&""
 
b=b&"<title>"&rshot("Title")&"</title>"&vbcrlf&""
 
b=b&"<pubDate>"&rshot("Intime")&" "&hour(now())&":"&minute(now())&":"&second(now())&"</pubDate>"&vbcrlf&""
 
b=b&"<bbs:lastDate>"&rshot("Intime")&" 10:26:42</bbs:lastDate>"&vbcrlf&""
 
b=b&"<bbs:reply>"&rshot("Classid")&"</bbs:reply>"&vbcrlf&""
 
b=b&"<bbs:hit>"&rshot("Hits")&"</bbs:hit>"&vbcrlf&""
 
b=b&"<bbs:mainLen>"&rshot("ID")&"</bbs:mainLen>"&vbcrlf&""
 
b=b&"<bbs:boardid>"&rshot("Author")&"</bbs:boardid>"&vbcrlf&""
 
b=b&"<bbs:pick>1</bbs:pick>"&vbcrlf&""
 
b=b&"</item>"&vbcrlf&""
 
i=i+1
 
rshot.movenext
 
loop
 
end if
 
rshot.close
 
set rshot=nothing
 
xmlfile=server.mappath("sitemap_baidu.xml")
 
Set fso = CreateObject("Scripting.FileSystemObject")
 
Set MyFile = fso.CreateTextFile(xmlfile,True)
 
MyFile.WriteLine("<?xml version=""1.0"" encoding=""GB2312"" ?>")
 
MyFile.WriteLine("<document xmlns:bbs=""http://www.baidu.com/search/bbs_sitemap.xsd"">")
 
MyFile.WriteLine("<webSite>http://www.mycodes.net/</webSite>")
 
MyFile.WriteLine("<webMaster>[email protected]</webMaster>")
 
MyFile.WriteLine("<updatePeri>12</updatePeri>")
 
MyFile.WriteLine nowtime
 
MyFile.WriteLine("<version>错新网</version>")
 
MyFile.WriteLine b
 
MyFile.WriteLine("</document>")
 
MyFile.Close
 
response.Redirect("sitemap_baidu.xml")
 
%>
 
 

(编辑:聊城站长网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章