- VBScript code
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%> <!--#include file="../Inc/Top.asp"--> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>无标题文档</title> </head> <body> <%xmlfile=server.mappath("/case/amline.xml") Set fso = CreateObject("Scripting.FileSystemObject") Set MyFile = fso.CreateTextFile(xmlfile,True) MyFile.WriteLine("<?xml version=""1.0""?>") MyFile.WriteLine("<main>") %> <%sql_ad1="select * from lanmu where bigclass=37 order by nb" Set rs_ad1= Server.CreateObject("ADODB.Recordset") rs_ad1.open sql_ad1,conn,1,1 do while not rs_ad1.eof %> <%MyFile.WriteLine "<dept name=""" & rs_ad1("lmname") & """>" %> <%sql_ad2="select * from Img where class2=38" Set rs_ad2= Server.CreateObject("ADODB.Recordset") rs_ad2.open sql_ad2,conn,1,1 do while not rs_ad2.eof %> <%MyFile.WriteLine "<city>"%> <%MyFile.WriteLine "<point name="""&rs_ad2("title")&""" url=""caseimg.asp?ID="&rs_ad2("id")&""" />"%> <%MyFile.WriteLine "</city>"%> <% rs_ad2.movenext loop rs_ad2.close set rs_ad2=nothing %> <%MyFile.WriteLine "</dept>"%> <% rs_ad1.movenext loop rs_ad1.close set rs_ad1=nothing %> <%MyFile.WriteLine "</main>"%> <% MyFile.close '关闭fout set MyFile=nothing '清空fout set fso=nothing %> </body> </html>
我用以上代码或者编码encoding="ISO10646“生成XML文件,然后用FLASH读取就不可以。但我用DREAMWEAVER打开后修改其中的一个汉字,然后再直接保存就可以读取了。 试着用encoding="GB2312"生成的修改了某个汉字还是不可以读取。是什么原因呢?我要怎样才能使生成的文件可以直接用FLASH读取?
------解决方案--------------------
flash设置useCodepage = true