Visual C# 和设置
我正在使用 Visual C# 内置功能设置来保存程序的一些选项。 看起来它正在使用 xml 文件来保存我的值,我可以轻松保存和加载设置,我的问题是如果我将源代码编译到应用程序,它在哪里保存这些值?它是否在某个地方创建了 xml 文件?如果是,那么在哪里? 我编译了一个程序并更改了一些设置,然后我将此可执行文件传输到我妈妈的计算机上,但它在选项中具有默认值。当我在她的计算机中使用应用程序进行更改时,它很好地保存了所有内容并记住了这些值。 程序在哪里创建这个 xml 文件来获取设置?
I am using Visual C# built in feature Settings to save some of my program's options.
It looks like it is using a xml file to save my values, I can save and load settings easily, my question is if I compile the source to an application, where does it hold these values? Does it make a xml filesomewhere, if it does, then where?
I compiled a program and changed some settings, then I transferred this executable to my mom's computer but it had default values in options. When I made changes with application in her computer, it saved everything well and it remembers those values.
Where does the program create this xml file to get settings?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
在带有二进制文件的 debug/release 文件夹中,它被命名为 yourapp.exe.config (或 web.config 对于 Web 应用程序)
inside the debug/release folder with the binary and it's named yourapp.exe.config (or web.config for web applications)
我想你指的是App.config?
I think you are referring to App.config?
查看 http://msdn.microsoft.com/en-us/library/k4s6c3a0 .aspx。
Check out http://msdn.microsoft.com/en-us/library/k4s6c3a0.aspx.
该问题已在此处提出
user.config 文件在
\\[Local Settings\]Application Data\\__< 中创建。 hash>\
文件夹。在哪里:The question has been asnwered here
The user.config file is created in the
<c:\Documents and Settings>\<username>\[Local Settings\]Application Data\<companyname>\<appdomainname>_<eid>_<hash>\<verison>
folder. Where:在我的 Windows 7 上,它将设置保存在
On my Windows 7 it saves the settings under