Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7048293
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T02:52:28+00:00 2026-05-28T02:52:28+00:00

We are delveloping C# windows based application .net 4 environment.In My application, i want

  • 0

We are delveloping C# windows based application .net 4 environment.In My application, i want to update settings file(app.config) attribute programatically.Actually we created one user interface(textbox).So, User will enter the new configuration information in the textbox.When clicking the save button, i want to update this value in settings file permanently.

for example:

I have Encryption Key in my settings file.Suppose, user may enter the new encryption key using that interface,then it will automatically update the settings file Encryption key value.

Is this possible?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T02:52:29+00:00Added an answer on May 28, 2026 at 2:52 am

    First of all you have to add this reference : System.Configuration , then you can write to app.config for example with this code :

            Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
    
            ConfigurationSectionGroup applicationSectionGroup = config.GetSectionGroup("applicationSettings");
            ConfigurationSection applicationConfigSection = applicationSectionGroup.Sections["YourApp.Properties.Settings"];
            ClientSettingsSection clientSection = (ClientSettingsSection)applicationConfigSection;
    
            //Encryption Key Configuration Setting
            SettingElement applicationSetting = clientSection.Settings.Get("EncryptionKey");
            applicationSetting.Value.ValueXml.InnerXml = this.textBoxKey.Text.Trim();
    
            applicationConfigSection.SectionInformation.ForceSave = true;
            config.Save();
    
            ConfigurationManager.RefreshSection("applicationSettings");
    

    Bear in mind that you have to create the app.config file before with the Visual studio wizard, in this example i have called the field for the encryption key : EncryptionKey and the related textbox in the form : textBoxKey .

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am Developing Windows Form Application in .Net, I want to insert selected rows
I am developing a windows based application in .net. I have two forms. Form2
I have worked with window based application in .net. But I want to learn
We are developing C#.Net 4.0 Windows form based application using Microsoft.Office.Interop.Word reference. Now I
We are developing C# .net 4.0 Windows Form Based Application. Here, User Will enter
We developing an Application using .NET Framework 4.0 (C#) windows forms based application. Now,
I am developing a Windows .NET application (WinForms) and I need to simulate a
I am developing a windows desktop client/server application in .NET where the client application
I am developing a ASP.Net website (Multibranch access and Multiuser Access) based on windows
Hi i am new here in developing Window Based Application using .NET. how we

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.