How to read and update XML file with Key and values using c# RRS feed

  • Question

  • User649011760 posted


    I want to read all nodes under '<appSettings>'  display key and values in windows form. How to read key and value  from below XML file using c#.

    I want to update few items under '<appSettings>' for example: I want to change the  <add key="name" value="testUser"/> to <add key key="name" value="Admin"/>, how to change using c#.

    <?xml version="1.0" encoding="utf-8" ?>
        <add key="IsAdmin" value="true" />
        <add key="name" value="testUser" />
        <add key="password" value="testpassword" />
        <add key="Country" value="Canada"/>


    Thursday, October 8, 2020 1:23 PM

All replies