在没有管理员权限的情况下打开 UAC 时,程序可以写入磁盘的根目录吗? [英] Can a program write to the root directory of a disk when UAC is turned on without having admin privileges?

查看:20
本文介绍了在没有管理员权限的情况下打开 UAC 时,程序可以写入磁盘的根目录吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我不是管理员并启动了一个写入 C:\ 某个文本文件的程序 - 我是否需要管理员权限...在 Windows 7 或 Vista 中?我看到在 XP 中写入任何文件夹都没有问题,包括 system32 - 但我不确定 .NET 中的程序是否能够在没有管理员权限的情况下做到这一点.

If I am not an Administrator and start a program which writes to C:\ some textfile - will I need admin rights...in Windows 7 or Vista? I see in XP there are no problems to write to any folder including system32 - but I am not sure if a program in say .NET will be able to do that without admin permissions.

推荐答案

那要看 C:\ 是否是支持权限的文件系统,如果是的话就看根目录上设置的权限,用户可以修改正确的特权.将 GetTempPath() 用于临时文件,或 SHGetFolderPath 传递例如CSIDL_APPDATA

That depends on whether C:\ is a filesystem that supports permissions, and if so on the permissions set on the root directory, which can be modified by users with the correct privileges. Use GetTempPath() for temporary files, or SHGetFolderPath passing e.g. CSIDL_APPDATA

这篇关于在没有管理员权限的情况下打开 UAC 时,程序可以写入磁盘的根目录吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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