老有乱码,救命!!!
Imports System.IO
’---------
‘变量声明
Dim sw As StreamWriter
Dim foolcat, fso, fout, FolderPath
‘-------------
foolcat = "document.write('" & foolcat & "')"
FolderPath = Server.MapPath("JS")
sw = File.CreateText(FolderPath + "\news.js")
sw.WriteLine(foolcat)
sw.Flush()
sw.Close()'----------asp.net的写法生成的js文件没有乱码,但网页调用的时候就是在网页上乱码。
我模仿ASP的写法
Dim foolcat, fso, fout, FolderPath
foolcat = "document.write('" & foolcat & "')"
FolderPath = Server.MapPath("JS")
fso = Server.CreateObject("Scripting.FileSystemObject")
fout = fso.CreateTextFile(FolderPath + "\news.js")
fout.WriteLine(foolcat)
'关闭连接
fout.close()
fout = Nothing'----------asp的写法生成的js文件没有乱码,跟asp.net的写法生成的.js文件是一样的,但网页调用的时候就是在网页上没有乱码。
晕死我了!
web.config里设置是GB2312
为什么会asp.net的写法生成的js文件没有乱码,调用就出现乱码,而且这个文件跟asp的写法生成的js文件用记事本打开是一样的。