ASP生成静态HTML文件!问题呀~

来源:百度知道 编辑:UC知道 时间:2024/05/22 13:03:32
Y = year(date())
M = month(date())
D = day(date())
foldername = Y & M & D
strFolderPath = "..\column\attention\" & foldername
strFilePath = strFolderPath & "\" & filename
set fso_file = server.CreateObject("Scripting.FileSystemObject")
template_MM = "..\column\" & "template.htm"

set gz_file = fso.OpenTextFile(template_MM)
template_NN = gz_file.ReadAll
template_NN = replace(template_NN,"$newtitle$",gz_name)
template_NN = replace(template_NN,"$new_title$",gz_name)
template_NN = replace(template_NN,"$new_time$",gz_addtime)
template_NN = replace(template_NN,"$new_content$",gz_content)
set fout = fso_file.CreateTextFile(server.MapPath("strFilePath"))
fout.writeLine (template_NN)
fout.close

运行后。。没有提示错误~把需要的内容response.write出来。。也都是正确的~但是就是不会生成HTN

把et gz_file = fso.OpenTextFile(template_MM)
template_NN = gz_file.ReadAll
template_NN = replace(template_NN,"$newtitle$",gz_name)
template_NN = replace(template_NN,"$new_title$",gz_name)
template_NN = replace(template_NN,"$new_time$",gz_addtime)
template_NN = replace(template_NN,"$new_content$",gz_content)
set fout = fso_file.CreateTextFile(server.MapPath("strFilePath"))
fout.writeLine (template_NN)
fout.close 删除就可以

template_MM = "..\column\" & "template.htm"
是否应该是
template_MM = Server.MapPath("..\column\" & "template.htm")?