title: Verifying links that need authentication
body: <p>I am trying to verify all the links in a particular site in C# using the request-response technique. I noticed that none of the links are returning "OK". I zeroed in on the problem. The site requires authentication. Knowing this, how should I be going about it????</p>
  
  <p>Here is my code sample:</p>
  
  <pre><code>WebRequest objWebRequest;
  HttpWebResponse objHttpResponse;
  try
  {
          objWebRequest = (HttpWebRequest)WebRequest.Create(strCheckingLink);
          objWebRequest.Timeout = 30000;
          objHttpResponse = (HttpWebResponse)objWebRequest.GetResponse();
          if (objHttpResponse.StatusCode == HttpStatusCode.Redirect)
          {}
          if (objHttpResponse.StatusCode == HttpStatusCode.OK)
          {
                  httpSCode = (int)objHttpResponse.StatusCode;
                  httpMsg = "OK";
                  invalidLink = false;
          }
          else
          {
                  invalidLink = true;
          }
  }
  </code></pre>