现在的位置: 首页 > 综合 > 正文

C#判断某个文件是否存在

2013年11月02日 ⁄ 综合 ⁄ 共 140字 ⁄ 字号 评论关闭

使用System.IO.File中的System.IO.File.Exists()方法

if (System.IO.File.Exists(@"文件路径"))
{
    Console.WriteLine("文件存在");
}
else
{
    Console.WriteLine("文件不存在..");
}

抱歉!评论已关闭.