asp按关键字查询XML的问题
'------------------------------------------------------
'读取文件 ReadTxtFile(FileName)
'------------------------------------------------------
Function ReadTxtFile(FileName)
Dim fso,f1,ts,FilePath
FilePath=server.mappath(FileName)
Set fso = CreateObject("Scripting.FileSystemObject")
Set ts = fso.OpenTextFile(FilePath,1,1)
ReadTxtFile = ts.ReadAll
set ts=nothing
set fso=nothing
End Function
'------------------------------------------------------------
'把信息写入文件
'------------------------------------------------------------
Function WriteTxtFile(Text,FileName)
path=Server.MapPath(FileName)
Set fso = CreateObject("Scripting.FileSystemObject")
Set f1 = fso.CreateTextFile(path,true)
f1.Write (Text)
f1.Close
End Function
'-----------------------------------------------------------
'生成xml文件
'-----------------------------------------------------------
msg = "<?xml version=""1.0"" encoding=""utf-8""?>"
msg=msg & "<bcaster>"
msg=msg & "<item item_url=""https://www.jb51.net"" itemtitle=""尊托云数""/>"
msg=msg & "</bcaster>"
call WriteTxtFile(msg,"x1.xml")
fso默认是ascII编码的,因为必须使用utf-8编码,用ado.stream来写这个文件,代码如下:
Sub CreateFile(Text,FileName)
Dim st
Set st=Server.CreateObject("ADODB.Stream")
st.Type=2
st.Mode=3
st.Charset="utf-8"
st.Open()
st.WriteText Text
st.SaveToFile Server.MapPath(FileName),2
st.Close()
Set st=Nothing
End Sub
msg = "<?xml version=""1.0"" encoding=""utf-8""?>"
msg=msg & "<bcaster>"
msg=msg & "<item item_url=""https://www.jb51.net"" itemtitle=""尊托云数""/>"
msg=msg & "</bcaster>"
call CreateFile(msg,"x1.xml")
项目中用到的一些特殊字符和图标 html代码 XML/HTML Code 复制内容到剪贴板 div ...
本文实例讲述了Laravel框架源码解析之反射的使用。分享给大家供大家参考,具体如...
上篇文章给大家介绍了 Java正则表达式匹配,替换,查找,切割的方法 ,接下来,...
错误描述: 在开发.net项目中,通过microsoft.ACE.oledb读取excel文件信息时,报...
正则忽略大小写 – RegexOptions.IgnoreCase 例如: 复制代码 代码如下: Str = R...
Elasticsearch 是通过 Lucene 的倒排索引技术实现比关系型数据库更快的过滤。特...
4月11日20:30~22:00通过腾讯会议进行了第二次在线学习讨论我把学习笔记整理一下...
复制代码 代码如下: % URL="http://news.163.com/special/00011K6L/rss_newstop....
工具:Eclipse,Oracle,smartupload.jar;语言:jsp,Java;数据存储:Oracle。...
DELETEFROMTablesWHEREIDNOTIN(SELECTMin(ID)FROMTablesGROUPBYName) Min的话保...