C # Using Settings under Visual Studio 2012

Source: Internet
Author: User

1. The settings setting in the project properties can be called in the following ways

Properties.Settings.Default. (Specifypropertyname)


2. Add a new settings settings file

Add a new item to the project and select Settings file to modify the name of the Settings file

When you click Add, you will be transferred to the designer view of the corresponding settings.

You need to drag the new settings file in the project to the properties of the project.

You can then call the

Properties. (Specifysettingsname). Default. (Specifypropertyname)

Multi-setting files can handle switching between multiple sets of settings.

3. save user settings at run time

Application scope settings are read-only and can be changed only at design time or by modifying the <assemblyname>.exe.config file between application sessions. However, user-scoped settings can be written at run time, just as you would change any property value. The new value will persist for the duration of the application session. You can maintain changes to user settings between application sessions by calling the Settings.save method. These settings are saved in the User.config file.

C # Using Settings under Visual Studio 2012

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.