在线用表单建立文件夹
类别: ASP教程
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 successfully! Called
<%=MyFolder%>
<%Else%%>
There has been an error.
<%End If
%>
<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 successfully! Called
<%=MyFolder%>
<%Else%%>
There has been an error.
<%End If
%>
- 上一篇: 把IP表存入SQL里的程序
- 下一篇: 有关站内模糊查询的源程序
-= 资 源 教 程 =-
文 章 搜 索