title: stop hashing operation using filestream
body: <p>I'm having this piece of code that computes the MD5 hash for a given input file.</p>
  
  <pre><code>    public static String ComputeMD5(String filename)
      {
          using (var md5 = MD5.Create())
          {
              try
              {
                  using (var stream = File.OpenRead(filename))
                  {
                      return BitConverter.ToString(md5.ComputeHash(stream)).Replace("-", "").ToLower();
                  }
              }
              catch (Exception)
              {
                  // File is not accessible, return String.Empty
                  return String.Empty;
              }
          }
      }
  </code></pre>
  
  <p>I'm running this time consuming operation in a separate thread. For very big files this operation may take some seconds/minutes. What I want to do is to be able to stop the operation from another thread, for example using a "Stop" button in the GUI. Any suggestions?</p>