怎样用ASP利用FSO生成文件,用当前日记时间命名文件名

来源:百度知道 编辑:UC知道 时间:2024/06/18 04:52:48
获取变量diary,在网站目录下生成一个以当前日记、时间命名的tzt文件(注意需要将日记进行格式化,否则不能做文件名),文件内容为变量diary的值。

请问代码怎么写?
我QQ:174810724,看不懂问题的可以加我Q来问,本问题一直追加到最高分!急用
1楼朋友的方法可以生成以日记为文件名的文件...可是能不能生成以 “年月日时分秒.txt” 这种格式的文件名呢?不然如果一天提交多个文件,之前的会被覆盖的...

<%
diary = "aaaaaaaaaa"
response.write time()
filename = year(date()) & month(date()) & day(date()) & hour(time()) & minute(time()) & second(time()) & ".txt"
set fso = server.createobject("scripting.filesystemobject")
thepath=server.mappath(filename)
set thefile = fso.createtextfile(thepath)
thefile.writeline diary
thefile.close
set fso = Nothing
%>
有什么其它得可以QQ:100770922