Ejemplo n.º 1
0
 public static void AssureDirectoryExist(string path)
 {
     if (!File.Exists(path))
     {
         var directoryPath = MFileEx.GetDirectoryName(path);
         if (!Directory.Exists(directoryPath))
         {
             Directory.CreateDirectory(directoryPath);
         }
     }
 }
Ejemplo n.º 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();
     }
 }