title: Cannot convert from method group to string when reading file C# .NET
body: <p>I got this software that scans a file that I select and then computes the MD5 hash.</p>
  
  <p>I am trying to compare the computed MD5 hash with a list of hashes from a dictionary to see if it matches, and if it does it says something.</p>
  
  <p>How do I programmatically add the dictionary.txt to my code.</p>
  
  <p>I tried using the <code>File.OpenRead()</code> but I am getting an error saying </p>
  
  <blockquote>
    <p>Argument 1: cannot convert from 'method group' to 'string'</p>
  </blockquote>
  
  <p>Did I miss something?</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.ComponentModel;
  using System.Data;
  using System.Drawing;
  using System.Linq;
  using System.Text;
  using System.Threading.Tasks;
  using System.Windows.Forms;
  using System.IO;
  using System.Security.Cryptography;
  
  namespace MD5_Hash_Compare
  {
      public partial class lblTitle : Form
      {
          public lblTitle()
          {
              InitializeComponent();
          }
  
          public string MD5HashFile(string fn)
          {
              byte[] hash = MD5.Create().ComputeHash(File.ReadAllBytes(fn));
              return BitConverter.ToString(hash).Replace("-", "");
          }
  
          private Stream TestStream()
          {
              Stream fs = File.OpenRead(@"C:\PathToDictionary");
              return fs;
          }
  
          public string GetMD5(string file)
          {
              using (var md5 = MD5.Create())
              using (var stream = File.OpenRead(TestStream))
              return Encoding.Default.GetString(md5.ComputeHash(stream));
          }
  
          private void lblTitle_Load(object sender, EventArgs e)
          {
  
          }
  
          private void scanButton_Click(object sender, EventArgs e)
          {
              string path = txtFilePath.Text;
  
              //if there is something in the textbox to scan we need to make sure that its doing it.
              if (!File.Exists(path))
              {
                // ... report problem to user.
                return;
              }
              else
              {
                  MessageBox.Show("Scan Complete");
              }
  
              hashDisplay.Text = MD5HashFile(path);
          }
  
          private void browseButton_Click(object sender, EventArgs e)
          {
              OpenFileDialog ofd = new OpenFileDialog();
              if (ofd.ShowDialog() == System.Windows.Forms.DialogResult.OK)
              {
                  txtFilePath.Text = (ofd.FileName);
              }
          }
      }
  }
  </code></pre>