<!-- #include file="_connection.asp" -->
<%
Set rs = Server.CreateObject("ADODB.Recordset")
rs.open "select * from _user ",conn,3,2
total=rs.recordcount
'------------------生成xml
Set f = Server.CreateObject("Scripting.FileSystemObject")
files = "output.xml" '文件输出路径
Set myfile = f.Createtextfile(server.mappath(files),true)
myfile.writeline "<?xml version=""1.0"" encoding=""UTF-8""?>"
myfile.writeline "<Document>"
do while not rs.Eof
myfile.writeline "<user>"
myfile.writeline "<ID>"&rs("id")&"</ID>"
myfile.writeline "<username>"&rs("username")&"</username>"
myfile.writeline "<sex>"&rs("sex")&"</sex>"
myfile.writeline "</user>"
rs.MoveNext()
loop
myfile.writeline "</Document>"
myfile.close
response.write "success"
%>
asp生成xml
最新推荐文章于 2020-12-03 08:07:54 发布