using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.IO; namespace DirectoryTest { class Program { static void Main(string[] args) { string path = @"C:\Users\pengshiyu\Desktop\source"; if(Directory.Exists(path)) Console.WriteLine("文件夹存在 "+path); else Console.WriteLine("文件夹不存在 "+path); Console.ReadKey(); } } }