|
Rank: Member Groups: Member
Joined: 12/3/2013 Posts: 16
|
Good Evening,
i have to force the language of the page on a WebBrowser in WinForm. The page that i display use the default browser language as the page language so it load the page in english. How can i force the WebView to set a different browser language?
Thank you!
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,196
|
Hi, You can handle WebView.BeforeRequestLoad and then set the "Accept-Language" header. For example:
Code: C#
//Handle BeforeRequestLoad event
WebView1.BeforeRequestLoad += new BeforeRequestLoadHandler(WebView_BeforeRequestLoad);
//BeforeRequestLoad handler
void WebView_BeforeRequestLoad(object sender, BeforeRequestLoadEventArgs e)
{
//Set Accept-Langauge to german
e.Request.Headers["Accept-Language"] = "de-DE";
}
Hope this helps. Thanks!
|
|
Rank: Member Groups: Member
Joined: 12/3/2013 Posts: 16
|
Thank you!!
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,196
|
You are welcome. Please feel free to let us know if there is anything else.
Thanks!
|
|