I have been a VB.net developer for a long time and changed recently to C#.
When I was using VB.net, to call user settings, I just need to create a new setting using the designer and then call it from code with the My namespace.
Here's the code
My.settings.anysetting
I can change or get data from it.
However in C# the My keyword doesn't work, so what can I do to call settings??
相关问题
- Sorting 3 numbers without branching [closed]
- Graphics.DrawImage() - Throws out of memory except
- Why am I getting UnauthorizedAccessException on th
- 求获取指定qq 资料的方法
- How to know full paths to DLL's from .csproj f
In my case this was for my connectionStrings setting but depending on what node your setting is in you can change this accordingly.
Hope this helps
Settings
are stored under theApplication
folder and as such, use that as their namespace.Using Settings in C#
Kinda like this:
Documentation: https://msdn.microsoft.com/en-us/library/bb397759(v=vs.110).aspx