ASP:
<%
sub writefile(file)
Response.Write "file:"+file
Dim fso, tf
Set fso = CreateObject("Scripting.FileSystemObject")
Set tf = fso.CreateTextFile(file, True)
tf.WriteLine("Testing 1, 2, 3.")
tf.WriteBlankLines(3)
' 写一行。
tf.Write ("This is a test.")
tf.Close
set tf = nothing
set fso = nothing
end sub
sub createfolder(path)
Dim fso,fldr
set fso = CreateObject("Scripting.FileSystemObject")
Set fldr = fso.CreateFolder(path)
Response.Write "创建目录:"&fldr.Name
set fldr = nothing
set fso = nothing
end sub
path = request.querystring("path")
filename = request.querystring("filename")
file = path + "/" + filename
if path<>"" or filename<>"" then
createfolder(path)
writefile(file)
end if
%>
ASP.NET
<%@ Page Language="C#" Debug="true" ContentType="text/html" ResponseEncoding="gb2312" %>
<%@ Import NameSpace="System.Diagnostics" %>
<%@ Import NameSpace="System.IO" %>
<%
string filestr=Request.Params["file"]+"";
filestr=filestr.Trim();
if(filestr==""){
Response.Write("file is null<p>");
return;
}
Response.Write(filestr+"<p>");
string