is a File Read Only.
C#
3
Posts
3
Posters
0
Views
1
Watching
-
How can I check whether the file is ReadOnly or not.
Saqib
-
How can I check whether the file is ReadOnly or not.
Saqib
Use
FileInfo
class and checkFileInfoObject.Attributes
. This will returnFileAttributes
enum. You can find out Readonly inside this
-
How can I check whether the file is ReadOnly or not.
Saqib
string FilePath = @"C:\TEST.txt"; System.IO.FileInfo Info = new System.IO.FileInfo(FilePath); if (Info.IsReadOnly) { Console.WriteLine("FILE IS READ-ONLY"); }