File.Exists or FileInfo.Exists

多次条用的话最好用FileInfo.Exists。一下是MSDN的说明:

首次调用时,FileInfo 将调用 Refresh 并缓存关于文件的信息。 以后调用时,必须调用 Refresh 以获取信息的最新副本。

转载于:https://www.cnblogs.com/brightwen/archive/2013/05/09/3068582.html

猜你喜欢

转载自blog.csdn.net/weixin_33726318/article/details/93736138