Equivalent to ‘app.config’ for a library (DLL)

You can have separate configuration file, but you’ll have to read it “manually”, the ConfigurationManager.AppSettings[“key”] will read only the config of the running assembly. Assuming you’re using Visual Studio as your IDE, you can right click the desired project → Add → New item → Application Configuration File This will add App.config to the project … Read more

Setting DEBUG = False causes 500 Error

Django 1.5 introduced the allowed hosts setting that is required for security reasons. A settings file created with Django 1.5 has this new section which you need to add: # Hosts/domain names that are valid for this site; required if DEBUG is False # See https://docs.djangoproject.com/en/1.9/ref/settings/#allowed-hosts ALLOWED_HOSTS = [] Add your host here like [‘www.beta800.net’] … Read more

Where are the Properties.Settings.Default stored?

In order to work with newer versions of Windows’ policy of only allowing read access by default to the Program Files folder (unless you prompt for elevation with UAC, but that’s another topic…), your application will have a settings folder under %userprofile%\appdata\local or %userprofile%\Local Settings\Application Data depending on which version of Windows you’re running, for … Read more

How to configure a static IP address, netmask, gateway programmatically on Android 3.x or 4.x

I realise that there is no API on 3.x or 4.x for those setting per SSID. Therefore, I checked out the source code and found out that the configuration of each SSID is stored in android.net.wifi.WifiConfiguration which is gotten from android.net.wifi.WifiManager. In the below code, IpAssignment is an Enum, either STAIC, DHCP or NONE. And … Read more

How do I open phone settings when a button is clicked?

Using UIApplication.openSettingsURLString Update for Swift 5.1 override func viewDidAppear(_ animated: Bool) { let alertController = UIAlertController (title: “Title”, message: “Go to Settings?”, preferredStyle: .alert) let settingsAction = UIAlertAction(title: “Settings”, style: .default) { (_) -> Void in guard let settingsUrl = URL(string: UIApplication.openSettingsURLString) else { return } if UIApplication.shared.canOpenURL(settingsUrl) { UIApplication.shared.open(settingsUrl, completionHandler: { (success) in print(“Settings … Read more

Can I control the location of .NET user settings to avoid losing settings on application upgrade?

I wanted to add this quoted text as a reference for when i have this problem in the future. Supposedly you can instruct the ApplicationSettings infrastructure to copy settings from a previous version by calling Upgrade: Properties.Settings.Value.Upgrade(); From Client Settings FAQ blog post: (archive) Q: Why is there a version number in the user.config path? … Read more

Instant run in Android Studio 2.0 (how to turn off)

Update August 2019 In Android Studio 3.5 Instant Run was replaced with Apply Changes. And it works in different way: APK is not modified on the fly anymore but instead runtime instrumentation is used to redefine classes on the fly (more info). So since Android Studio 3.5 instant run settings are replaced with Deployment (Settings … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)