title: Read a particular value from INI file to Text box
body: <p>I need to be able to read the "Country=" section of the INI file and place the value in a text box in my application? The text box is called "cbxctry". I have looked at using <code>streamreader</code> but not sure if this is correct? Please let me know if you need any further information.</p>
  
  <p>INI File</p>
  
  <pre><code>[Carrier]
  Name=Singtel
  ChargeStructure=Business Rates
  CountryId=88
  Country=Singapore
  Ident=99101
  MeterRate=0
  DefaultChargeBand=N
  NetworkDigits=
  
  [CallCategories]
  N=National
  I=International
  M=Mobile
  L=Local
  F=Free
  P=Premium
  DE=Directory Enquiries
  </code></pre>
  
  <hr>
  
  <p>CODE</p>
  
  <pre><code>private void btnnewtariff_Click_1(object sender, EventArgs e)
  {
      Stream myStream = null;
      SaveFileDialog openFileDialog1 = new SaveFileDialog();
  
      openFileDialog1.InitialDirectory = @"D:\tig2020\Carriers\'";
      openFileDialog1.Filter = "inf files (*.Inf)|*.Inf|All files (*.*)|*.*";
      openFileDialog1.FilterIndex = 1;
      openFileDialog1.RestoreDirectory = false;
      openFileDialog1.OverwritePrompt = true;
  
      if (openFileDialog1.ShowDialog() == DialogResult.OK)
      {
          try
          {
              if ((myStream = openFileDialog1.OpenFile()) != null)
              {
                  using (myStream)
                  {
                      txtnewtariff.Text = openFileDialog1.FileName;
                  }
              }
          }
          catch (Exception ex)
          {
              MessageBox.Show("Error: Could not read file from disk. Original error: " + ex.Message);
  
          }
  </code></pre>