c#创建文件夹

实例:在c#中 在D盘下面创建一个abc的文件夹,然后在文件夹里面创建一个123.txt的文档

string path = @"D:abc";
string fileName = "123.txt";
if (!Directory.Exists(path))
{
      Directory.CreateDirectory(path);
}
if (!File.Exists(path + "\" + fileName))
{
      File.Create(path + "\" + fileName);
}

原文地址:https://www.cnblogs.com/lqsilly/p/3303697.html