title: Running Two Functions at the Same Time in C#
body: <p>I have created a class library in my project which scans a series of files. In my main project which uses this DLL as a reference, I'd like to create a progress bar which shows how many file have been scanned so far. </p>
  
  <p>The dll class makes use of a foreach loop since it's purpose is to turn each file into a hash code. The foreach loop has been used to join each converted segment of a file together so that I can have a 512 bit long code, and then it proceeds to the next file. </p>
  
  <p>I have defined a variable in the dll class which is --></p>
  
  <pre><code>public static int value_ = 0;
  </code></pre>
  
  <p>This variable is updated at the the end of the foreach loop. </p>
  
  <p>Now in my main project, I'd like to use this variable to update my progress bar at the same time the function in my class library project is running. </p>
  
  <p>For example :</p>
  
  <pre><code>DLL.function();
  pb.value = value_;
  </code></pre>
  
  <p>I'd appreciate any hint on how I can implement this.</p>