湖南长沙八年做网站,网络优化推广服务团队,让您小投资大回报,帮您打开网络营销财富之门!
 业务服务热线:0731-88571521  13637482004  
 


地址:长沙市韶山南路248号南园503
      室(潇湘晨报旁)
电话:0731-88571521
手机:136-3748-2004
Q  Q:44377655 522392221
网址:www.gzkanyi.com
邮箱:522392221@qq.com
精辟网文
长沙做网站联系电话:0731-88571521 13637482004

ASP生成XML动态数据读取代码实例

信息来源:长沙做网站   发布时间:2014-2-12   浏览:

网站建设ASP生成XML动态数据读取代码实例

<!--#include file="M_conn.asp"-->
<%
username=request("username")
set rshot=server.CreateObject("adodb.recordset")
sql="select * from TZ_all where username='"&username&"' order by id desc"
rshot.open sql,conn,1,1
if not (rshot.eof and rshot.bof) then
i=0
do while not rshot.eof
line=line&"  <value xid="""&i&""">"&rshot("rl_time")&"</value>"&vbcrlf&""
line2=line2&"   <value xid="""&i&""">"&rshot("rl")&"</value>"&vbcrlf&""
i=i+1
rshot.movenext
loop
end if
rshot.close
set rshot=nothing

xmlfile=server.mappath("/party/amline/value_indicator/amline_rl_"&username&".xml")
Set fso = CreateObject("Scripting.FileSystemObject")
Set MyFile = fso.CreateTextFile(xmlfile,True)
MyFile.WriteLine("<?xml version=""1.0"" encoding=""UTF-8""?>")
MyFile.WriteLine("<chart>")
MyFile.WriteLine(" <series>")
MyFile.WriteLine line
MyFile.WriteLine(" </series>")
MyFile.WriteLine(" <graphs>")
MyFile.WriteLine("  <graph gid=""1"">")
MyFile.WriteLine line2
MyFile.WriteLine("  </graph>")
MyFile.WriteLine(" </graphs>")
MyFile.WriteLine("</chart>")
MyFile.Close
response.Redirect("m_my_bar.asp?username="&username&"")
%>

 

<%
xmlfile=server.mappath("/html/news....newstest1.xml.html")
Set fso = CreateObject("Scripting.FileSystemObject")
Set MyFile = fso.CreateTextFile(xmlfile,True)
MyFile.WriteLine("<?xml version=""1.0"" encoding=""UTF-8""?>")
MyFile.WriteLine("<chart>")

MyFile.WriteLine(" <series>")
MyFile.WriteLine("  <value xid=""0"">1997</value>")
MyFile.WriteLine("  <value xid=""1"">1997</value>")
MyFile.WriteLine(" </series>")

MyFile.WriteLine(" <graphs>")
MyFile.WriteLine("  <graph gid=""1"">")
MyFile.WriteLine("   <value xid=""0"">50</value>")
MyFile.WriteLine("   <value xid=""1"">50</value>")
MyFile.WriteLine("  </graph>")
MyFile.WriteLine(" </graphs>")

MyFile.WriteLine("</chart>")
MyFile.Close
%>
<a href="test1.xml">长沙斌网网络请您 查看XML文件内容</a>



相关热点文章


地址:长沙市韶山南路248号南园503室(潇湘晨报旁)  网站ICP备案号:湘ICP备09008272号  版权所有:365官网
咨询电话:0731-88571521   136-3748-2004
业务 QQ:客服一 1306053142 客服二 1320506001 技术/售后 522392221 高级顾问 44377655
服务邮箱:fanbin@binweb.cn   522392221@qq.com
官方网址:www.gzkanyi.com   www.pk0731.com
旗下网站:斌网网络  长沙信息处  佛佛网  晒土货网