本文实例讲述了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#程序设计有所帮助。
新闻热点
疑难解答