1.写数据
fo=Server.MapPath("SFZH_MD.txt")
set fs=Server.CreateObject("Scripting.FileSystemObject")
set fn=fs.CreateTextFile(fo,True)
fn.Write “DDD”
fn.Close
2.打开此文件,但好像只能在服务器访问才行
fo=replace(fo,"\","\\")
response.Write "<script >"
response.Write "(new ActiveXObject(""wscript.shell"")).run("""&fo&""")"
response.write "< /script>"
3.保存文件
Response.clear
fo=Server.MapPath("SFZH_MD.txt")
Response.ContentType = "application/octet-stream"
Response.AddHeader "Content-Disposition","attachment;filename=SFZH_MD.txt;charset=GB2312"
Const ForReading = 1, ForWriting = 2, ForAppending = 8
Const TristateUseDefault = -2, TristateTrue = -1, TristateFalse = 0
Dim fso, f, ts
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.GetFile(fo)
Set ts = f.OpenAsTextStream(ForReading, TristateUseDefault)
Do While ts.AtEndOfLine <> True
Response.write(ts.ReadLine)
Loop
ts.Close
set fso=nothing