title: An object reference is required for the non-static field, method, or property
body: <p>Ok.  I'm having an issue with the following bit of code:</p>
  
  <pre><code>StreamReader arrComputer = new StreamReader(FileDialog.FileName);
  </code></pre>
  
  <p>My first question had been answered already now my second question focuses on the tail end of this code.</p>
  
  <p>I'm reading a text file <code>StreamReader</code> that the user selects with a button event using <code>OpenFileDialog</code> </p>
  
  <pre><code>private void button1_Click(object sender, EventArgs e)
  
  
          {
              OpenFileDialog fileDialog = new OpenFileDialog();
              fileDialog.InitialDirectory = @"C:\";
              fileDialog.Filter = "Text|*.txt|All|*.*";
              if (fileDialog.ShowDialog() == DialogResult.OK) ;
              textBox1.Text = fileDialog.FileName;
              buttonRun.Enabled = true;
          }
  </code></pre>
  
  <p>The later in the code the user will click a "Run" button to execute some code against each item in the list.</p>
  
  <p>I'm having problems using StreamReader to parse the list using the following code:</p>
  
  <pre><code>private void buttonRun_Click(object sender, EventArgs e)
          {
              StreamReader arrComputer = new StreamReader(FileDialog.FileName);
  
          }
  </code></pre>
  
  <p>This is the error I receive from my coding:</p>
  
  <pre><code>"An object reference is required for the non-static field, method, or property 'System.Windows.Forms.FileDialog.FileName.get' "
  </code></pre>
  
  <p>I think I understand the problem but I'm having a hard time working it out.</p>