My application has a folder Data
which either already exists when the application is run or is created when it runs. My problem is that I can't get it to have write access. When I manually uncheck Read-only through Windows file explorer and hit Apply and OK, it's check I open its Properties again! So I'm wondering if there's a way for me to fix that or do it programmatically. The method I have for creating the folder is
private void CreateDataFolderIfNotExists ( )
{
if ( !System.IO.Directory.Exists(this._datadir) )
{
System.IO.Directory.CreateDirectory(this._datadir);
}
}
and I'm wondering if the .NET framework has some option for making the folder this._datadir
have write access either when it is created or retroactively.