title: Get progress of an async call
body: <p>I'm using a block of code I got from a blog, to upload images to IMGur using API v3.</p>
  
  <p>It works fine, but I wanted to implement a progress bar system to let the user know how much has been uploaded, if the program deals with high res images.</p>
  
  <p>So far I haven't been able to do so.</p>
  
  <p>I'm not an experienced coder, just doing this as a learning project.</p>
  
  <p>The Code:</p>
  
  <pre><code>public object UploadImage(string image) 
  { 
      WebClient w = new WebClient();
      w.UploadProgressChanged += (s, e) =&gt; { };
      w.UploadValuesCompleted += (s, e) =&gt; { };
      w.Headers.Add("Authorization", "Client-ID " + ClientId);
      System.Collections.Specialized.NameValueCollection Keys = new System.Collections.Specialized.NameValueCollection(); 
      try 
      { 
          Keys.Add("image", Convert.ToBase64String(File.ReadAllBytes(image))); 
          byte[] responseArray = w.UploadValues("https://api.imgur.com/3/image", Keys);
  
  
          dynamic result = Encoding.ASCII.GetString(responseArray); System.Text.RegularExpressions.Regex reg = new System.Text.RegularExpressions.Regex("link\":\"(.*?)\""); 
          System.Text.RegularExpressions.Match match = reg.Match(result); 
          string url = match.ToString().Replace("link\":\"", "").Replace("\"", "").Replace("\\/", "/");
          textBox1.Text = url;
          return url; 
      }
      catch (Exception s) 
      { 
          MessageBox.Show("Something went wrong. " + s.Message); 
              return "Failed!"; 
      } 
  }
  </code></pre>
  
  <p>At first I tried using the events <code>UploadProgressChanged</code> and <code>UploadValuesCompleted</code>, but they are not triggered, my theory is they are triggered when <code>UploadValuesAsync</code> is called instead of <code>UploadValues</code>.</p>
  
  <ol>
  <li>How do I implement a progress system?</li>
  <li>What is the difference between async and normal transfer?</li>
  </ol>