Silverlight中如何获取当前浏览器的语言版本
目前想获取当前浏览器的语言 ,不知道怎么获取?请各位大侠指点!
[解决办法]
BrowserInformation browserInfo = HtmlPage.BrowserInformation;
[解决办法]
对silverlight不熟,建议使用js获取浏览器语言,然后silverlight从后台取js里面取出来
[解决办法]
silverlight中可以使用System.Windows.Browser.HtmlPage探测浏览器信息,例如:
var browserInfo = HtmlPage.BrowserInformation;
BrowserInformation = "You are using " + browserInfo.Name + "
(Product Name: " + browserInfo.ProductName +
" - " + browserInfo.ProductVersion + ") Version: " +
browserInfo.BrowserVersion;
Platform = "You are on " + browserInfo.Platform + "
platform and using User Agent: " + browserInfo.UserAgent;
protected string culture = string.Empty;
protected string uiculture = string.Empty;
protected void Page_Load(object sender, EventArgs e)
{
culture = Thread.CurrentThread.CurrentCulture.Name;
uiculture = Thread.CurrentThread.CurrentUICulture.Name;
}