come creare una cartella con c# code example
Example: come creare una cartella con c#
using System;
using System.IO;
class Test
{
public static void Main()
{
string path = @"c:\MyDir";
try
{
if (Directory.Exists(path))
{
Console.WriteLine("That path exists already.");
return;
}
DirectoryInfo di = Directory.CreateDirectory(path);
Console.WriteLine("The directory was created successfully at {0}.", Directory.GetCreationTime(path));
di.Delete();
Console.WriteLine("The directory was deleted successfully.");
}
catch (Exception e)
{
Console.WriteLine("The process failed: {0}", e.ToString());
}
finally {}
}
}