Access Denied to any folder, C#
Getting this strange error.
开发者_如何学运维In C#, I write to a file (txt) whose location I provide at run-time.
The problem is that whatever location I provide, It returns an error: Access to "..path.." is denied.
I checked the permissions, but the required permissions are set.
My code snippet
folderBrowserDialog.ShowDialog();
StreamWriter path = new StreamWriter(folderBrowserDialog.SelectedPath);
.
.
.
Any known issues or something I am missing?
Thanks
You should pass a file name to StreamWriter. It looks as if you're passing a folder name.
精彩评论