开发者

Access Denied to any folder, C#

开发者 https://www.devze.com 2023-01-04 08:16 出处:网络
Getting this strange error. 开发者_如何学运维In C#, I write to a file (txt)whose location I provide at run-time.

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消