Hello,
I have an application which reads a license file when it starts up. My install creates the folder in Program Files for the application, creates the license folder and puts the license file in there. However when I try and run the application, it needs to read/update the license file. When I try and do that I get an "Unauthorized Access Exception". I am logged on as an administrator and I'm running the program manually.
Any idea why I cannot access that file even though the path is correct? But in the install it creates the file and folder just fine?
I have MyApplication.exe, and my license reader is in a seperate DLL called MyApplicationTools. I am reading/write the license file like so:
//Read
StreamReader reader = new StreamReader(path + "license.lic");
//Write
StreamWriter writer2 = new StreamWriter(path + "License.lic");
string str = Convert.ToBase64String(sharedkey.Key);
writer2.WriteLine(str);
writer2.Close();
Thanks