如何找出一个文件存在于C#/。NET?文件、NET

2023-09-02 02:07:41 作者:渡口有过寒鸦

我想测试包含文件路径是否存在该文件(有点像 -e 测试在Perl或 os.path.exists()在Python)在C#。

I would like to test a string containing a path to a file for existence of that file (something like the -e test in Perl or the os.path.exists() in Python) in C#.

推荐答案

使用:

File.Exists(path)

MSDN:http://msdn.microsoft.com/en-us/library/system.io.file.exists.aspx

编辑:System.IO

In System.IO

 
精彩推荐
图片推荐