使用fso建立目录的程序,如果有多级目录,则一级一级的创建
'建立目录的程序,如果有多级目录,则一级一级的创建 Function CreateDIR(ByVal LocalPath) On Error Resume Next LocalPath = Replace(LocalPath,"\","/") Set FileObject = Server.CreateObject("Scripting.FileSystemObject") patharr = Split(LocalPath,"/") path_level = UBound(patharr) For i = 0 to path_level If i=0 Then pathtmp=patharr(0) & "/" Else pathtmp = pathtmp & patharr(i) & "/" cpath = Left(pathtmp,Len(pathtmp)-1) If Not FileObject.FolderExists(cpath) Then FileObject.CreateFolder cpath Next Set FileObject = Nothing If Err.Number <> 0 Then CreateDIR = False Err.Clear Else CreateDIR = True End If End Function
飞飞Asp技@术乐园
|