C#WebBrowser控件全球化 [英] C# WebBrowser Control Globalization

查看:206
本文介绍了C#WebBrowser控件全球化的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用WebBrowser控件在C#中的应用程序。
问题是,我不是从一个讲英语的国家,控制接缝发送英语,而不是当前的文化。

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.

因此​​,例如,像谷歌网站将始终用英文代替葡萄牙人展现出来,因为它出现在IE,FF,Chrome或歌剧。

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.

在Accept-Language头似乎是硬连接到使用用户的Internet设置配置的文化。如果在additionalHeaders参数WebBrowser.Navigate提供一个值,该值将被覆盖。

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.

我还发现了一个注册表设置:
HKEY_CURRENT_USER /软件/微软/ Internet Explorer中/国际/ AcceptLanguage

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

更改此注册表设置也应该修改WebBrowser控件的Accept-Language头。

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

不幸的是我的情况,我希望能够覆盖设置WebBrowser控件的特定实例,而不是修改可能由其他应用程序使用全局设置。因此,这种方法是没有用的。不过,也许它会帮助你。

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.

这篇关于C#WebBrowser控件全球化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆