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