asp 创建与删除文件与文件夹
创建文件夹名称"www.236z.com"
<% 
Foldertocreate=server.mappath("") &"/cgi-bin/myfiles"   
Set fs = CreateObject("Scripting.FileSystemObject") 
Set a = fs.CreateFolder(Foldertocreate)  
Set fs=nothing 
%> 
Done
 
删除文件 www.236z.com
<% 
Foldertodelete=server.mappath("") &"/cgi-bin/111cn"   
Set fs = CreateObject("Scripting.FileSystemObject") 
fs.DeleteFolder(Foldertodelete)  
Set fs=nothing 
%> 
Done
 
删除文件夹,判断文件存在时再删除.
<% 
Foldertodelete=server.mappath("") &"/cgi-bin/myfiles"   
Set fs = CreateObject("Scripting.FileSystemObject") 
   if fs.FolderExists("c:temp") then 
      fs.DeleteFolder "c:temp" 
   end if 
Set fs=nothing 
%> 
 
                    
                     
                    
                 
                    
                 
 
         
                
            
         浙公网安备 33010602011771号
浙公网安备 33010602011771号