开发者

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.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜