Windows 7 不允许我编辑 Common Application Data 文件夹中的文件 [英] Windows 7 doesn't allow me edit files in Common Application Data folder

查看:25
本文介绍了Windows 7 不允许我编辑 Common Application Data 文件夹中的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在 Windows 7 下的通用应用程序数据中存储一些文件并为我的软件编辑它们.

I want to store some files and edit them for my software in common Application Data under Windows 7.

我不知道为什么 Windows 7 不允许我的软件更改文件除非我以管理员身份运行它们.

I do not know why Windows 7 doesn't allow my software to change files unless I run them as administrator.

我在哪里可以存储我的文件,这样就不需要管理员权限?

Where can I store my files, so it won't require admin permission?

推荐答案

您应该将应用程序数据存储在 Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData); 下的子文件夹中.请注意,此文件夹是特定于用户的.

You should store your application data in a subfolder under Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData); . Note that this folder is user-specific.

非管理员用户无权写入 CommonApplicationData 文件夹,因为该文件夹不属于特定用户.

Non-Admin users do not have permission to write to the CommonApplicationData folder, because that folder does not belong to specific users.

请注意,您还可以使用设置类来存储您的设置.为此,将新项目添加到您的项目中,选择设置文件".这适用于字符串和数字等基本设置.

Note that you can also store your settings by using the Settings Class. To do so, add New Item to your project, pick "Settings File". This is appropriate for basic settings like strings and numbers.

这篇关于Windows 7 不允许我编辑 Common Application Data 文件夹中的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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