'创建多层目录的方法 '所需支持:服务器必须启用FSO和RegExp '使用方法:传入一个目录路径 就可以创建 'By CoderLee 2006.10.10 Sub LeesCreateFolder(Folder) Dim RegEx, arrFolder, thisFolder '使用正则表达式搜索出每级目录 便于依次创建 Set RegEx =New RegExp RegEx.Pattern ="[^\\]+\\"'搜索所有的非\字符和\ 如d:\a\网络\cc 则结果为 d:\ a\ 网络\ cc RegEx.IgnoreCase =True RegEx.Global =True Set arrFolder = RegEx.Execute(Folder) Set RegEx =Nothing Set fsoLee = Server.CreateObject("Scripting.FileSystemObject") ForEach SubFolder In arrFolder thisFolder = thisFolder & SubFolder '一层一层的推进 IfNot fsoLee.FolderExists(thisFolder) Then Response.Write(thisFolder) fsoLee.CreateFolder(thisFolder) '如果该层不存在则创建 EndIf Next Set fsoLee =Nothing End Sub