我正在使用Visual C#内置功能设置来保存我的程序的一些选项。 它看起来像使用xml文件来保存我的值,我可以轻松地保存和加载设置,我的问题是如果我将源代码编译到应用程序,它在哪里保存这些值?它是否会生成一个xml文件,如果有,那么在哪里? 我编译了一个程序并且改变了一些设置,然后我把这个可执行文件传给了我母亲的电脑,但是它的选项有默认值。当我在计算机上对应用程序进行更改时,它将所有内容都保存得很好,并记住了这些值。 程序在哪里创建此xml文件以获取设置?Visual C#和设置
2
A
回答
1
的问题已经asnwered here
在<c:\Documents and Settings>\<username>\[Local Settings\]Application Data\<companyname>\<appdomainname>_<eid>_<hash>\<verison>
文件夹中创建user.config文件。其中:
* <c:\Documents and Settings> is the user data directory, either non-roaming (Local Settings above) or roaming.
* <username> is the user name.
* <companyname> is the CompanyNameAttribute value, if available. Otherwise, ignore this element.
* <appdomainname> is the AppDomain.CurrentDomain.FriendlyName. This usually defaults to the .exe name.
* <eid> is the URL, StrongName, or Path, based on the evidence available to hash.
* <hash> is a SHA1 hash of evidence gathered from the CurrentDomain, in the following order of preference:
1. StrongName
2. URL
If neither of these is available, use the .exe path.
* <version> is the AssemblyInfo's AssemblyVersionAttribute setting.
0
与二进制调试/ release文件夹内,它的命名yourapp.exe.config(或web.config中的Web应用程序)
+1
对于特定于应用程序的选项为true。如果您将该设置标记为特定于用户的设置,它会进入您的用户配置文件文件夹。 – 2010-10-13 13:44:29
1
在我的Windows 7是
C:\Users\<user>\AppData\Roaming<application name>\<exefile name>\<version>\user.config
0
下保存设置我认为你指的是App.config?
0
相关问题
- 1. 使用C++和Visual Studio 2008设置OpenGL
- 2. 默认设置visual C#
- 3. Visual C++ 2010默认设置
- 4. 用mysql c api设置visual studio c + + 2008
- 5. 重置Visual Studio C++项目的设置
- 6. 设置Visual Studio 2013和SourceTree
- 7. 在Visual Studio(C#)编译时设置值?
- 8. MS Visual C++环境如何设置?
- 9. Visual C#2008控件设置路径
- 10. Visual Studio中的C#设置错误
- 11. 如何存储Visual C++调试设置?
- 12. 微软的Visual Studio C#设置
- 13. Visual Studio - “{}”设置
- 14. Visual SourceSafe设置
- 15. 在Visual C中通过WPF Windows获取和设置变量#
- 16. 设置opengl和visual studio 2010的问题
- 17. visual studio - iis7 - 设置?
- 18. Visual Studio Tooltipster设置
- 19. Visual Studio 2017重置设置
- 20. C#封装(获取和设置)
- 21. C#和Visual Studio?
- 22. Lua和Visual C++
- 23. C++:使用Clang和VS14设置DebugInformationFormat
- 24. Visual C#Express 2010:如何将语言设置为C#2.0
- 25. C#设置Rembering设置
- 26. Visual C++指导设备
- 27. Visual Studio的颜色设置
- 28. visual-studio项目设置
- 29. Visual Studio设置图库
- 30. visual studio/installshield设置项目
谢谢你的回答! – 2010-10-13 14:41:39
我的荣幸!祝你K-1职业生涯顺利;) – 2010-10-13 14:50:02