c# - Why does System.IO.File.Exists(string path) return false? -
system.io.file.exists(string path)
returns false, when file exists on specified path. possible solution?
it permission problem. documentation:
the exists method returns false if error occurs while trying determine if specified file exists. can occur in situations raise exceptions such passing file name invalid characters or many characters, failing or missing disk, or if caller not have permission read file.
one way of seeing what's happening try read file (e.g. file.openread
). i'd surprised if succeeds - if fails, exception should give more information.
Comments
Post a Comment