How To Set User-Agent In Web Client In ASP.NET

  1. using(WebClient web = new WebClient())   
  2. {  
  3.     web.Headers["User-Agent"] = "Mozilla/4.0 (Compatible; Windows NT 5.1; MSIE 6.0) " + " (compatible; MSIE 6.0; Windows    NT 5.1; " + ".NET CLR 1.1.4322; .NET CLR 2.0.50727)";  
  4. }