拒绝访问路径D:\ [英] Access to path D:\ is denied

查看:1027
本文介绍了拒绝访问路径D:\的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

获取异常:

Getting an Exception :

FileStream outputStream = new FileStream("D:\\" , FileMode.Create,FileAccess.ReadWrite,FileShare.ReadWrite);


Access to path D:\ is denied.

我具有管理员权限和创建文件的权限,然后我也遇到了相同的异常.

请帮忙.


Access to path D:\ is denied.

I have admin permissions and permission to create file then also I getting the same exception.

please help.

推荐答案

似乎您正在尝试打开目录本身. "D:\\"用于写入,而不是文件.
使用文件名("D:\\ thisWorks.txt")再试一次,看它是否对您更好.
It seems you are attempting to open directory, itself. "D:\\" for writing, rather than a file.
Try again with a filename, ("D:\\thisWorks.txt") and see if it works out better for you.


这篇关于拒绝访问路径D:\的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆