using(WebClient web = new WebClient())
{
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)";
}This code snippet is for to set user-agent in web client in ASP.NET
