After the drive is finished, the folder is then manipulated. These include extracting folder information, creating folders, deleting folders, copying folders, moving folders, and so on. Here's a concrete look.
First, FSO. GetFolder
A look is clear, is the extraction folder. Which folder is that specifically extracted? Definitely follow the path to a folder. Extract it and then display the information about the folder? Whether there is to be specific extraction down. So, look at the program:
1,getfldr.asp
<%
Set fso = CreateObject("Scripting.FileSystemObject")
Set fldr = fso.GetFolder("c:\Program Files")
Response.Write "父文件夹名字是:" & fldr & "<br>"
If fldr.IsRootFolder = True Then
Response.Write "该文件夹是一根文件夹" & "<br>"
Else
Response.Write "该文件夹不是根文件夹" & "<br>"
End If
Response.Write "驱动器名字是:" & fldr.Drive & "<br>"
%>
It is essential to establish a connection to the FSO component first, then set Fldr = FSO. GetFolder ("C:\Program Files") sets the Fldr object to be assigned as a reference to the following program.
Fldr. IsRootFolder is to determine whether the folder is a folder and the value is a Boolean (true or false); Fldr. Drive displays the drive letter for the folder.
Second, FSO. CreateFolder
The next more exciting is the creation of a folder through ASP, you can create any folder within your jurisdiction.
2,creatfldr.asp
<%
Set fso = CreateObject("Scripting.FileSystemObject")
fso.CreateFolder ("c:\cnbruce")
Response.Write "文件夹名为" & fso.GetBaseName("c:\cnbruce")
%>
Execution procedures, should find C disk more out of the Cnbruce folder, FSO. Getbasename is the extraction folder name.
Third, FSO. DeleteFolder
You can create a folder from ASP, and you can also delete the folder.
3,delfldr.asp
<%
Set fso = CreateObject("Scripting.FileSystemObject")
fso.DeleteFolder("c:\cnbruce")
Response.Write "文件夹已删除"
%>