Posted on 2010-08-19 08:56
lxasp 阅读(839)
评论(1) 编辑 收藏 引用 所属分类:
AJAX
function autoMakeDir(strPath){
try{
var astrPath, ulngPath, i, strTmpPath;
var fso = new ActiveXObject("Scripting.FileSystemObject");
if (fso.FolderExists(strPath)) return true;
astrPath = strPath.split("\\");
ulngPath = astrPath.length;
strTmpPath = "";
for(i = 0 ; i<ulngPath ;i++ ){
strTmpPath += astrPath[i] + "\\";
if (!fso.FolderExists(strTmpPath))
fso.CreateFolder (strTmpPath);
}
return true;
}catch(e){
return false;
}
}