示例#1
0
 public static void AssureDirectoryExist(string path)
 {
     if (!File.Exists(path))
     {
         var directoryPath = MFileEx.GetDirectoryName(path);
         if (!Directory.Exists(directoryPath))
         {
             Directory.CreateDirectory(directoryPath);
         }
     }
 }
示例#2
0
 public static void AssureFileExist(string path)
 {
     if (!File.Exists(path))
     {
         var directoryPath = MFileEx.GetDirectoryName(path);
         if (!Directory.Exists(directoryPath))
         {
             Directory.CreateDirectory(directoryPath);
         }
         FileStream fileStream = File.Create(path);
         fileStream.Close();
     }
 }