根據基本目錄及文件的全路逕,創建相應的子目錄,爲保存文件作準備
2010-12-13 12:00 Koy 阅读(162) 评论(0) 编辑 收藏 举报 public static string GenerateDirectoryByFileFullPath(string basePath, string fileFullPath){
DirectoryInfo dirInfo = new DirectoryInfo(basePath);
string fileName = new DirectoryInfo(fileFullPath).Name;
string subDir = fileFullPath.Replace(basePath, "").Replace(fileName, "").Trim('\\');
return dirInfo.CreateSubdirectory(subDir).FullName;
}