asp中如何将for循环出来的内容写入fso中

2025-03-24 22:23:02
推荐回答(2个)
回答1:

<%
dim body
body=""
for i=1 to 10
body=body & "i="&i&"" & vbcrlf
next
Set fso = Server.CreateObject("Scripting.FileSystemObject")
Set fout = fso.Createtextfile(server.MapPath("/temp.txt"),true)
fout.writeline body
fout.close
set fout=nothing
set fso=nothing
%>

回答2:

向FSO写入

fso.write("
")
向FSO写入换行
fso.write("vbcrlf")