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