开发者

FileInfo.Exists not reliable with UNC path

I want to determine if a UNC file exists. I create a FileInfo object, then call FileInfo.Exists. But it'll occasionally return false, even if the file actually exists.

How can I accurately determine i开发者_开发百科f a UNC file exists?


You can't do this in a general sense, because as Ben mentions, you might not have ACLs to see if it exists. That being said, the best way to determine if a file exists (based on your scenario) is to attempt to open the file

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜