标题 | asp输出xml |
内容 | asp输出xml,早就应用到本站的rss上了,但是一直没有写出来asp代码如何输出的.下面贴出来. 代码入席: <%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%> <% Response.Charset = "utf-8" '这里是输出xml格式页面编码 Response.ContentType="text/xml" '这里是设置输出的是xml文件 RSSSTR = RSSSTR & "<?xml version=""1.0"" encoding=""utf-8""?>"&vbcrlf'这里是设置xml的编码 RSSSTR = RSSSTR & "<rss version=""2.0"">"&vbcrlf RSSSTR = RSSSTR & "<channel>"&vbcrlf RSSSTR = RSSSTR & "<title>网站制作学习网</title>"&vbcrlf RSSSTR = RSSSTR & "<description>网站制作学习</description> "&vbcrlf RSSSTR = RSSSTR & "<link>http//:www.forasp.cn</link>"&vbcrlf RSSSTR = RSSSTR & "<generator>forasp.cn</generator>"&vbcrlf RSSSTR = RSSSTR & "<language>zh-cn</language>"&vbcrlf RSSSTR = RSSSTR & "<copyright>Copyright 2008-2009 forasp.cn</copyright>"&vbcrlf RSSSTR = RSSSTR & "<webMaster>站长</webMaster>"&vbcrlf RSSSTR = RSSSTR & "<email>admin@forasp.cn</email>"&vbcrlf RSSSTR = RSSSTR & "<image>"&vbcrlf RSSSTR = RSSSTR & " <title>网站制作学习网</title> "&vbcrlf RSSSTR = RSSSTR & " <url>/uploads/202504/02/logo23338.gif</url> "&vbcrlf RSSSTR = RSSSTR & " <link>http://www.forasp.cn/</link> "&vbcrlf RSSSTR = RSSSTR & " <description>网站制作学习网logo</description> "&vbcrlf RSSSTR = RSSSTR & "</image>"&vbcrlf RSSSTR = RSSSTR & RSSCONTENT RSSSTR = RSSSTR & "</channel>"&vbcrlf RSSSTR = RSSSTR & "</rss>"&vbcrlf response.Write (RSSSTR) %> 需要注意的是asp输出xml的页面编码必须跟开头设置的输出xml页面编码一致,否则会导致乱码 |
随便看 |
|
在线学习网考试资料包含高考、自考、专升本考试、人事考试、公务员考试、大学生村官考试、特岗教师招聘考试、事业单位招聘考试、企业人才招聘、银行招聘、教师招聘、农村信用社招聘、各类资格证书考试等各类考试资料。