My.Settings 在 VB 2010 .NET 中保存在哪里?
My.Settings
值是保存在程序本身中还是存储在注册表中?因此,例如,如果我使用程序设置了 My.Settings
值,那么我将程序本身复制到另一台 PC - My.Settings
值是否仍然设置?
Are My.Settings
values saved in the program itself or do they get stored in the registry? So, for example, if I set a My.Settings
value with a program, then I copy the program itself to another PC - is the My.Settings
value still set?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
这取决于您选择的范围。有两个范围设置 - 应用程序范围和用户范围。
来自 MSDN 文章:
It depends upon the scope you have selected. There are two scope settings - Application and User scope.
From MSDN article:
如果您使用 clickonce 安装了应用程序,那么您的 MySettings 将存储在配置文件中,该文件存储在 `C:\Users\\AppData\Local\Apps\2.0\Data......
在这些路径中搜索名为 yourapp.exe.config 的文件
MySettings 将存储在该应用程序的 app.config 文件中,发布后 app.config 文件将保存为 applicationname.exe.config 文件
If you have installed your application using clickonce then your MySettings will be stored in a config file which is stored at `C:\Users\\AppData\Local\Apps\2.0\Data........
search in these path with a file named as yourapp.exe.config
The thing is MySettings will be stored in app.config file of that application and after publishing the app.config file is saved as applicationname.exe.config file
如果它们是用户设置,它们绝对不会存储在程序中 - 这不是很容易实现,而且毫无意义。相反,它们存储在 %AppData% 文件夹中的配置文件中。所以不,如果您复制了该程序,则不会附带用户设置,而只会附带应用程序设置。
They're definitely not stored within the program if they're User settings - that's not very easy to implement, and rather pointless. Rather, they're stored in a configuration file in the %AppData% folder. So no, if you copied the program, the User settings wouldn't come with it, just the Application settings.