G
Guest
I am using the System.IO.File class to determine if a file exists on a
network share.
The File.Exists method keeps returning false, even though the file does
exist. The MSDN documentation states,
"If the caller does not have sufficient permissions to read the specified
file, no exception is thrown and the method returns false regardless of the
existence of path."
So this explains my problem. But in my code, I would like to know if 1)the
file does not exist or 2)the file does exist, but the user does not have
sufficient permissions. So my question is, how do I determine (catch) if the
problem is insufficient permissions.
Is there another class that I can use or am I simply out of luck?
network share.
The File.Exists method keeps returning false, even though the file does
exist. The MSDN documentation states,
"If the caller does not have sufficient permissions to read the specified
file, no exception is thrown and the method returns false regardless of the
existence of path."
So this explains my problem. But in my code, I would like to know if 1)the
file does not exist or 2)the file does exist, but the user does not have
sufficient permissions. So my question is, how do I determine (catch) if the
problem is insufficient permissions.
Is there another class that I can use or am I simply out of luck?