简体   繁体   中英

C# WebBrowser Control Globalization

I am making an application in C# using the WebBrowser control. Problem is i am not from an english speaking country and that control seams to send an english language instead of Current Culture.

So for example, sites like google will always show up in english instead of portuguese, as it appears in IE, FF, Chrome or Opera.

Is there a way to change that control's page request culture to the current system's culture, or any arbitrary culture for that matter?

I've tried various means to solve this problem with little success.

The Accept-Language header seems to be hard-wired to use the culture configured in the user's Internet Settings. If you supply a value in the additionalHeaders parameter to WebBrowser.Navigate, this value will be overridden.

If you change this, your WebBrowser control should send the correct language.

I've also found a registry setting: HKEY_CURRENT_USER/Software/Microsoft/Internet Explorer/International/AcceptLanguage

Changing this registry setting should also modify the WebBrowser control's Accept-Language header.

Unfortunately in my case, I want to be able to override the setting in a particular instance of the WebBrowser control and not modify global settings which may be used by other applications. So this approach is of no use. However, perhaps it will help you.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM