时间:2022-02-20 09:27:01 | 栏目:.NET代码 | 点击:次
本文实例讲述了C#简单创建和删除目录的方法。分享给大家供大家参考。具体如下:
using System; using System.IO; class DirectoryCreation { public static void Main() { string directoryString = Directory.GetCurrentDirectory() + @"\TestDir"; Directory.CreateDirectory (directoryString); Console.WriteLine ("Created: {0}", directoryString); Directory.Delete (directoryString); Console.WriteLine ("Deleted: {0}", directoryString); } }
希望本文所述对大家的C#程序设计有所帮助。