在线用表单建立文件夹

发表于:2007-06-30来源:作者:点击数: 标签:
使用ASP的FSO(filesystemobject)组件,通过表单,用户可以在线建立文件夹。制作方法: HTML格式的Form表单文件FOLDER.htm的内容: form name="form1" method="post" action="folder-action.asp" Create a folder input type="text" name="name" input type=
使用ASP的FSO(filesystemobject)组件,通过表单,用户可以在线建立文件夹。制作方法:

HTML格式的Form表单文件FOLDER.htm的内容:
<form name="form1" method="post" action="folder-action.asp">
Create a folder
<input type="text" name="name">
<input type="submit" name="Submit" value="Submit">
</form>

ASP文件FOLDER-ACTION.ASP
<%@ LANGUAGE = "VBScript" %>
<% Dim Name
Name = Request("Name")
set fs=createobject("scripting.filesystemobject")
MyFolder=server.mappath(""&name&"")
If NOT fs.folderexists(MyFolder) then
fs.createfolder(MyFolder)
End If
If fs.folderexists(MyFolder) then
%> Folder created suclearcase/" target="_blank" >ccessfully! Called
<%=MyFolder%>
<%
Else
Response.Write "There has been an error."
End If
%>

原文转自:http://www.ltesting.net