如何更改Properties.Settings的默认路径 [英] how to change default path for Properties.Settings
本文介绍了如何更改Properties.Settings的默认路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
每当我执行 Properties.Settings.Save()
时,它都会将属性更改提交给 Application.LocalUserAppDataPath
,但我希望路径为 Application.CommonAppDataPath
.
Whenever I do Properties.Settings.Save()
, it commites the properties changes to Application.LocalUserAppDataPath
but I want the path to be 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
请让我知道是否可以更改.如果是这样,请让我知道如何?
Please let me know whether it's possible to change. If so, please let me know how?
推荐答案
在调用 Properties.Settings.Save();之前,先使用
Properties.Settings.Default.ParentPath = Application.CommonAppDataPath;
.
这篇关于如何更改Properties.Settings的默认路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文