title: Using WebClient to ping a web site
body: <p>I have a tiny app that I wanting to run and ping an internal web site.  Here is the code:</p>
  
  <pre><code>using (var client = new WebClient())
  {
      client.DownloadString("http://MyServer/dev/MyApp");
  }
  </code></pre>
  
  <p>However, it is throwing the following error:  </p>
  
  <blockquote>
    <p>The remote server returned an error: (401) Unauthorized.</p>
  </blockquote>
  
  <p>I have all the correct credentials to access the server.  I am thinking I don't know how to use WebClient very well and I just need to set properties on the client object.  Any ideas?</p>