对了,你应该有公共包含文件吧?把这个文件写在公共包含文件里,就很好办了,至于我的办法,我给你些代码参考,下面是扁历目录和操作文件的的代码,你自己修改下用吧
<%
fpath=Server.MapPath(".")
set fso=server.createobject("scripting.filesystemobject")
set myfiles=fso.getfolder(fpath)
set f=myfiles.files
for each g in f
response.write ("本目录下有文件" & g.name & "<br>")
next
set f=nothing
set myfiles=nothing
set fso=nothing
%>
下面是asp写入htm、asp文件的方法
<%
if fso.FileExists(fPath & "\" & fname)=true then
content="<!-- #include file=xxx-->"
Set fout = fso.CreateTextFile(fPath & "\" & fname)
fout.WriteLine content
fout.close
Set fout=nothing
Set fso = Nothing
response.write "成功写入文件!<br>"
end if
%>