且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

C#编程-112:文件夹操作之判断是否存在

更新时间:2022-06-25 03:29:30

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();
        }
    }
}

C#编程-112:文件夹操作之判断是否存在C#编程-112:文件夹操作之判断是否存在