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