Mar*_*oms 6 .net c# windows application-data roaming-profile
我有一个WPF应用程序,必须为具有相同设置的计算机的所有用户运行.必须读/写设置.例如,我以前一直在CommonApplicationData中存储用户配置设置
var settingsFile = Path.Combine(Environment.GetFolderPath(
Environment.SpecialFolder.CommonApplicationData),
"[company]", "[product]", "settings.xml");
Run Code Online (Sandbox Code Playgroud)
但是我今天早上读到的CommonApplicationData用于漫游配置文件,这意味着它们不是特定于机器的.根据我的发现,我们有以下应用程序数据选项(来源):
// Store application-specific data for the current roaming user.
// A roaming user works on more than one computer on a network.
// A roaming user's profile is kept on a server on the network and is loaded onto a system ' when the user logs on.
System.Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
// Store in-common application-specific data that is used by all users.
System.Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData);
// Store application-specific data that is used by the current, non-roaming user.
System.Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
Run Code Online (Sandbox Code Playgroud)
总而言之,选项是
我需要的是所有用户,非漫游.我最初的想法是将它全部放入安装文件夹,但这似乎有点老派?
思考?
| 归档时间: |
|
| 查看次数: |
2606 次 |
| 最近记录: |