修订:在window7中创建目录 [英] Revised : create directory in window7

查看:120
本文介绍了修订:在window7中创建目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的所有人
我是C#的新手,我使用Visual Studio C#2008创建了一个目录.使用Directory.Create函数可以在Windows XP中正常工作.但是在寡妇7中失败.在Windows7中运行时,我收到一条错误消息,错误消息是访问路径被拒绝.任何人都可以帮助我
问候
ak.naser

Dear All
I am new in C#, i create a directory using visual studio C# 2008. using Directory.Create function it works fine in windows xp. but failed in widows 7. i have a error message while run in windows7 the error message is access path denied. any one help me please
regards
ak.naser

推荐答案

这是访问权限问题.如果您在 C:\ 上创建目录.在Vista和Windows 7(以及Windows Server 2008/2008 R2)中,此设置(受设计保护)-普通用户帐户没有在其中创建目录的任何权限
您需要先登录Administrator,然后再尝试输入代码.
It''s a access permisson issue. if you create directory on C:\. This is protected (by design) in Vista and Windows 7 (and Windows Server 2008 / 2008 R2) - normal user accounts do not have any permission to create directories in there
You need to login with Administrator and then try your code.


正如其他人所说,这归结为权限问题.运行代码的用户没有权限在您尝试执行此操作的文件夹中创建文件夹.普通用户帐户无法在系统中所需的任何位置创建文件夹.这是设计使然,可以保护系统和用户.

您极有可能尝试在驱动器的根目录或Program Files文件夹中创建一个文件夹.在这种情况下,您必须重新设计应用程序,以便将其数据存储在更合适的位置.
As the others have said, this comes down to a permissions problem. The user that the code is running as does not have permissions to create a folder in the folder that you are trying to do this. Normal user account cannot create folders anywhere they want in the system. This is by design to protect the system and the user.

You are more than likely trying to create a folder at the root of a drive or in the Program Files folder, among others. If this is the case, you have to redesign your application so it stores its data in more appropriate locations.


如果您尝试在C驱动器中创建目录,请以管理员身份运行应用程序.然后就可以了
If u r try to create a directory in C drive please run u r application as administrator. Then it works


这篇关于修订:在window7中创建目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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