实践xml缓存技术构建高性能web站点
作者 佚名技术
来源 ASP编程
浏览
发布时间 2012-03-12
ontent = xmlcontent & "<?xml version=""1.0"" encoding=""gb2312""?>" & vbnewline xmlcontent = xmlcontent & " <root>" & vbnewline xmlcontent = xmlcontent & " <totalrec>" & TotalRec & "</totalrec>" & vbnewline Dim k k = 0 Dim field While Not rs.eof and k<sPagesize xmlcontent = xmlcontent & " <item " For Each field In rs.Fields xmlcontent = xmlcontent & field.name & "=""" & XMLStringEnCode(field.value) & """ " Next xmlcontent = xmlcontent & "></item>" & vbnewline rs.movenext k=k+1 Wend rs.close Set rs = Nothing xmlcontent = xmlcontent & " </root>" & vbnewline Dim folderpath folderpath = Trim(left(xmlfile,InstrRev(xmlfile,"\")-1)) Call CreateDIR(folderpath&"") ''创建文件夹 WriteStringToXMLFile xmlfile,xmlcontent End Function Rem xml转义字符 Private Function XMLStringEnCode(str) If str&"" = "" Then XMLStringEnCode="":Exit Function str = Replace(str,"<","<") str = Replace(str,">",">") str = Replace(str,"''","'") str = Replace(str,"""",""") str = Replace(str,"&","&") XMLStringEnCode = str End Function Rem 写文件 Private Sub WriteStringToXMLFile(filename,str) ''On Error Resume Next Dim fs,ts Set fs= createobject("scripting.filesystemobject") If Not IsObject(fs) Then Exit Sub Set ts=fs.O |
凌众科技专业提供服务器租用、服务器托管、企业邮局、虚拟主机等服务,公司网站:http://www.lingzhong.cn 为了给广大客户了解更多的技术信息,本技术文章收集来源于网络,凌众科技尊重文章作者的版权,如果有涉及你的版权有必要删除你的文章,请和我们联系。以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢! |
你可能对下面的文章感兴趣
上一篇:
WEB共享与IIS相结合快速建立本地网站
下一篇:
ASP程序直接连接MYSQL数据库
关于
实践xml缓存技术构建高性能web站点
的所有评论