Load Config file into Windows Forms
<p>I am attempting to build a tool using C# to modify the config files for our software.  The config files are in the following format:</p>

<p>SERVER_NAME       TestServer<br>
SERVER_IP         127.0.0.1<br>
SERVICE_NUMBER    4<br>
SERVICE_ID        1 2 3 4  </p>

<p>And so on.  Each line is prefaced with an identifier(Ex: SERVER_NAME), then the value.  I need the tool to load the value for each identifier into a separate text box.  When the user clicks save, it needs to write the updated information to the file.</p>

<p>I am entirely lost on how I should load the data into the text boxes, so if you could provide some help on that, I would appreciate it.</p>

<p>Writing it, I am assuming the easiest way, since all of the data will be loaded, is to erase the previous data, and write the new data to the file.  This I should be able to handle without a problem.  If there is a better way to do this, I am definitely willing to try.</p>

<p>I would greatly appreciate some pointers on how to get started with loading the data.</p>

<pre><code>private void openToolStripMenuItem_Click(object sender, EventArgs e)
    {
        openFD.ShowDialog();
        openFD.Title = "Open a Config File...";
        openFD.InitialDirectory = "C:";
        openFD.FileName = "";
        openFD.Filter = "CONFIG|*.cfg";

        string selected_file = "";
        selected_file = openFD.FileName;

        using (StreamReader sr = new StreamReader(selected_file))
        {
            string currLine;
            while ((currLine = sr.ReadLine()) != null)
            {

            }
        }
    }
</code></pre>
