System.IO.Directory.CreateDirectory(目录名)
解决方案 »
- 请教FILETIME转成DataTime
- c# tabControl alignment为left后 看不见标签名字 - -
- C#如何查看对象的地址
- winform 怎么防止重复登录
- 又是因为vss,受气
- 请问如何将C#中的结构体转换为byte[]
- 如何做一个类似于抽奖的程序
- 想实现数据库连接缓存功能,但不知道如何编写,急!在线等待!
- webbrowser 如何自动加载下一页呢
- 请问在C#中当用Socket与服务器建立连接后,如何向服务器发送HTTP协议的指令,如GET、HEAD等?当发送了指令后,也应如何接收服务器响应的
- winform中,不断用Graphics.DrawImage方法时有残留现象,怎么解决??
- 在 .net 精简版中,我把internet上的一张图片抓下,却不知道如何存成文件
using System.IO;class Test
{
public static void Main()
{
// Specify the directory you want to manipulate.
string path = @"c:\MyDir"; try
{
// Determine whether the directory exists.
if (Directory.Exists(path))
{
Console.WriteLine("That path exists already.");
return;
} // Try to create the directory.
DirectoryInfo di = Directory.CreateDirectory(path);
Console.WriteLine("The directory was created successfully at {0}.", Directory.GetCreationTime(path)); // Delete the directory.
di.Delete();
Console.WriteLine("The directory was deleted successfully.");
}
catch (Exception e)
{
Console.WriteLine("The process failed: {0}", e.ToString());
}
finally {}
}
}