application-settings

Application Settings scope - user vs application

北慕城南 提交于 2021-02-19 12:53:36
问题 If I create a user level application setting and bind it to a text box on a form, then type something in the textbox, the value is automatically saved and when the application is launched again the value appears in the textbox. This doesn't happen when I scope the setting as application. Why are application scoped settings not saved automatically like user scoped settings are? If this is by design, how can I manually save these settings and load them at runtime? 回答1: In short, application

Application Settings scope - user vs application

对着背影说爱祢 提交于 2021-02-19 12:52:00
问题 If I create a user level application setting and bind it to a text box on a form, then type something in the textbox, the value is automatically saved and when the application is launched again the value appears in the textbox. This doesn't happen when I scope the setting as application. Why are application scoped settings not saved automatically like user scoped settings are? If this is by design, how can I manually save these settings and load them at runtime? 回答1: In short, application

Add name in My.Settings

≯℡__Kan透↙ 提交于 2021-02-16 20:19:58
问题 How to add a new name in My.Settings? So far, I've learned how to read and edit values in it, but how can I add another row/name at run-time? Something like: My.Settings.AddName.String("foo1") My.Settings.Save() My.Settings.foo1 = "fooNew" I can't see such on the web.. Thanks EDIT: will be used for the name,text and location of dynamically added buttons. SeeThisLink 回答1: The My.Settings application settings are compiled into your assembly. The properties cannot be altered at runtime because

How to create an application settings parameter of type a custom struct (or class)?

梦想的初衷 提交于 2021-02-08 07:43:47
问题 Having this struct: public struct MyStruct { public int MyInt { get; set; } public bool MyBool { get; set; } public string MyString { get; set; } public MyStruct(int myint, bool mybool, string mystring) { MyInt = myint; MyBool = mybool; MyString = mystring; } } How to store a value of this type in the application settings? The type is not available in the list of the new parameter to select its type and browing to enter the fully qualified type name does not work as it is not found. Most of

How to keep the last used folder and put it in a textbox when a form opens?

╄→гoц情女王★ 提交于 2021-02-01 05:06:14
问题 When the C# form is loaded, I want to have a folder in a textbox belonging to the user who is logged on by default. I have textbox and buttons for an input and output file, and when the form is opened I want the user to see the default folder where he saved the previous output file. How can I do this? 回答1: Double click on the Settings.settings in the Properties section of the project in the solution explorer. It opens the parameters wizard containing a grid view. At bottom, add a parameter

How to keep the last used folder and put it in a textbox when a form opens?

て烟熏妆下的殇ゞ 提交于 2021-02-01 05:03:29
问题 When the C# form is loaded, I want to have a folder in a textbox belonging to the user who is logged on by default. I have textbox and buttons for an input and output file, and when the form is opened I want the user to see the default folder where he saved the previous output file. How can I do this? 回答1: Double click on the Settings.settings in the Properties section of the project in the solution explorer. It opens the parameters wizard containing a grid view. At bottom, add a parameter

How do I setup the Application Settings by code?

微笑、不失礼 提交于 2021-01-29 09:25:29
问题 I'm using Visual Studio 2017, and I have a boat load of settings I'm adding. It's kind of a pain in the neck to add them by this Settings.settings table in VS. Is there a better way? 回答1: If you have the option of not using the default settings application behavior, or if you can use another bahavior in addition to it, perhaps it may help you: How to create a hand-made application settings file In this case, this may help you too: How to initialize user app data and document path So you can

Where has my Settings Editor gone in my Project Properties Menu?

耗尽温柔 提交于 2020-08-19 11:02:57
问题 I'm trying place a DB connection string in an app config file for my C# console project in VS Community 2019 so I can access the string from a central location. I had to create an app.config file by adding a new one to my project. When I try to access it using the ConfigurationManager, I get a NullReferenceException 'Object not set to an instance of an object'. These are my App.config file contents: <?xml version="1.0" encoding="utf-8" ?> <configuration> <connectionStrings> <add name =

Unable to upload/download blob storage to container from local environment

*爱你&永不变心* 提交于 2020-07-22 12:04:29
问题 I have an exiting functions app that has the functionality to download a file from sftp, process the file and upload file to blob storage. This functions app is already deployed in azure and working properly. However, when I run the same thing from visual studio (local) I get error at uploading file to blob storage. Microsoft.Azure.Storage.StorageException: This request is not authorized to perform this operation using this permission. I made sure this app has the necessary contributor role