I am using File.ReadAllLines to read the contents of a text file. But, if the file has the ReadOnly property, or if the user does not have Write permission to the file, then the ReadAllLines method throws an exception saying "Access to path 'path-to-file' is denied".
Is there some way to use File.ReadAllLines and read the contents of a ReadOnly file?