如何更改 Properties.Settings 的默认路径
每当我执行Properties.Settings.Save()
时,它都会将属性更改提交到Application.LocalUserAppDataPath
,但我希望路径为Application.CommonAppDataPath
>。
请
Application.CommonAppDataPath =
C:\Documents and Settings\**All Users**\Application Data\xxxxx\xxxx\1.0.0.0
Application.LocalUserAppDataPath =
C:\Documents and Settings\**gsankar**\Local Settings\Application Data\xxxxx\xxxx\1.0.0.0
让我知道是否可以更改。 如果是这样,请告诉我如何做?
Whenever I do Properties.Settings.Save()
, it commites the properties changes to Application.LocalUserAppDataPath
but I want the path to be Application.CommonAppDataPath
.
where
Application.CommonAppDataPath =
C:\Documents and Settings\**All Users**\Application Data\xxxxx\xxxx\1.0.0.0
Application.LocalUserAppDataPath =
C:\Documents and Settings\**gsankar**\Local Settings\Application Data\xxxxx\xxxx\1.0.0.0
Please let me know whether it's possible to change. If so, please let me know how?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在调用
Properties.Settings.Save();
之前使用Properties.Settings.Default.ParentPath = Application.CommonAppDataPath;
。use
Properties.Settings.Default.ParentPath = Application.CommonAppDataPath;
before callingProperties.Settings.Save();
.