application-settings

Why are my application settings not getting persisted?

﹥>﹥吖頭↗ 提交于 2019-11-28 00:51:51
So I have some settings that are of the user scope, but for some reason, they are not being saved to the .exe.config file. I do the following: Properties.Settings.Default.Email = "new@value.com"; Properties.Settings.Default.Save(); Yet I look at the settings file in the debug folder and it is still the default that I set in visual studio. Am I doing this wrong? User settings are specific to the user, so they wouldn't get saved back to the .exe.config file, which is system wide. From the docs of LocalSettingsProvider : Application-scoped settings and the default user-scoped settings are stored

Accessing another project's settings file

六月ゝ 毕业季﹏ 提交于 2019-11-27 21:48:08
Is there a way to access the settings file from a different project? For example, I have a solution that contains 2 projects (Lets call them Proj1 and Proj2). I want to access the application settings of Proj2 from Program.cs in Proj1. Is this possible? Option A : parse the values out of the other assembly's configuration file (where the settings are stored) Option B : create a public class in Proj2 that exposes the necessary values from its settings as static properties, then reference the assembly in Proj1 and consume the values from that class. Option C : If you want to expose ALL the

Save little information as setting in android (like first time that app is run)

送分小仙女□ 提交于 2019-11-27 21:09:52
问题 I want to save a flag for recognizing that my app is run for the first time or not. For this simple job I don't want to create database.. Is there a simple option to do this? I want to save and read little pieces of information only. 回答1: Use SharedPreferences . SharedPreferences preferences = getSharedPreferences("prefName", MODE_PRIVATE); SharedPreferences.Editor edit= preferences.edit(); edit.putBoolean("isFirstRun", false); edit.commit(); 回答2: Use sharedPreference or files to save the

Why aren't .NET “application settings” stored in the registry?

会有一股神秘感。 提交于 2019-11-27 20:19:33
问题 Some time back in the nineties, Microsoft introduced the Windows Registry. Applications could store settings in different hives. There were hives for application-wide and user-specific scopes, and these were placed in appropriate locations, so that roaming profiles worked correctly. In .NET 2.0 and up, we have this thing called Application Settings. Applications can use them to store settings in XML files, app .exe.config and user .config. These are for application-wide and user-specific

Automatically “upgrade” user settings from previous version of app.config file?

三世轮回 提交于 2019-11-27 19:22:23
Every time I compile my app and the version number changes (I have an auto-incrementing build number), I lose the user-configured app.config settings, since they're stored in the AppData folder for a specific version. Essentially, every release of my application starts from scratch as far as user settings go. While this is a mild annoyance in development, it raises the question as I approach deployment/release - if I use the app.config to store my user settings, will the user's personalized settings be hosed every time they install a patch that changes the version number of my app? If so, is

how to change .NET user settings location

巧了我就是萌 提交于 2019-11-27 17:49:42
问题 By default settings are stored at: C:\Documents and Settings\\Local Settings\Application Data\<Project Name> How can I change this path to application directory. I also don't want to have different files for different users. How make the settings global? I tried to change the scope of the settings to "application" but then I cannot change them at runtime. 回答1: Using the default built-in behavior you can't! Q: Why is the path so obscure? Is there any way to change/customize it? A: The path

Find current country from iPhone device

你。 提交于 2019-11-27 17:10:00
I have to get the current country in the iPhone settings. Can anyone tell me how to get the current country in iPhone application. I have to use the current country for parsing the RSS feed in which I need to pass the current country. Please help me out to find the country . Thanks in advance. kennytm To find the country of the user's chosen language: NSLocale *currentLocale = [NSLocale currentLocale]; // get the current locale. NSString *countryCode = [currentLocale objectForKey:NSLocaleCountryCode]; // get country code, e.g. ES (Spain), FR (France), etc. In Swift: let currentLocale =

Dependency Injection and AppSettings

守給你的承諾、 提交于 2019-11-27 16:30:38
问题 Let's say I am defining a browser implementation class for my application: class InternetExplorerBrowser : IBrowser { private readonly string executablePath = @"C:\Program Files\...\...\ie.exe"; ...code that uses executablePath } This might at first glance to look like a good idea, as the executablePath data is near the code that will use it. The problem comes when I try to run this same application on my other computer, that has a foreign-language OS: executablePath will have a different

Max value of Xmx and Xms in Eclipse?

跟風遠走 提交于 2019-11-27 15:42:39
问题 Now my settings for these in the ini file are: -Xms768M -Xmx1024M When setting them higher, eclipse doesn't start anymore... Is there a way to increase these values without eclipse crashing? 回答1: The maximum values do not depend on Eclipse, it depends on your OS (and obviously on the physical memory available). You may want to take a look at this question: Max amount of memory per java process in Windows? 回答2: I am guessing you are using a 32 bit eclipse with 32 bit JVM. It wont allow

Can someone provide a quick App.config/Web.config tutorial?

ぐ巨炮叔叔 提交于 2019-11-27 15:08:38
问题 I've used these two configuration files many times before, but I've never taken the time to fully understand how they really work. As most people do, I understand the basics in how to call WebConfigurationManager.AppSettings["key"] to get config values. Here are some questions I came up with: What happens when you reference a configuration value within a class library, and the library is part of a bigger solution? Does the app.config need to be copied to the output directory in order for the