views:

92

answers:

1

how to give read only access to the xml file in c#?

+7  A: 

This code will help :-

using System.IO;

FileInfo flInfo = new FileInfo(@"c:\alok.txt"); // load file
flInfo.Attributes = FileAttributes.ReadOnly; // set file attribute
thatsalok