<html>
<form name="frmReadFile" method="post" action="savetoserver.asp">
文件的内容为:
<%
'飞云编写
'可以自由引用修改,但是请注明出处或保留链接
'我的个人站点http://www.pifoo.com
'QQ33323489
set fso=CreateObject("Scripting.FileSystemObject")
set hFile=fso.OpenTextfile("Autoexec.bat")
sFileContent=hFile.Readall() '读取文件内容
sEditControl="<TextArea name=""FileContent"">" & sFileContent & "</TextArea>"
response.write(sEditControl) '构造,并显示一个文本框
set hFile=nothing
set fso=nothing
%>
<input type="submit" name="btnSubmit" value="提交">
</form>
读取客户端文件成功!
</html>
<%
a=request.form("FileContent")
fname="1.txt"
fpath=Server.MapPath(".")
set fso=server.createobject("scripting.filesystemobject")
set mytxt=fso.createtextfile(fPath & "\" & fname,true,false)
mytxt.write a
mytxt.close
response.write "写入服务器成功!<br>"
set mytxt=nothing
set fso=nothing
%>