webclient C# User agent code example Example: WebClient c# with custom user agent client.Headers["User-Agent"] = "myUserAgentString";