- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
在 .NET 应用程序中,您似乎可以通过以下方式获取或设置当前 (UI) 区域性
System.Threading.Thread.CurrentThread.CurrentUICulture
或通过
System.Globalization.CultureInfo.CurrentUICulture
一个比另一个更受青睐吗?还是 CultureInfo.CurrentUICulture
只是从 Thread.CurrentThread.CurrentUICulture
中读取?
最佳答案
根据 the MSDN entry对于 CultureInfo.CurrentUICulture:
This read-only property is equivalent to retrieving the CultureInfo object returned by the System.Threading.Thread.CurrentThread.CurrentUICulture property.
所以你的第二个问题的答案肯定是肯定的。
既然它们本质上是一样的,我相信它们之间的选择取决于个人喜好,仅此而已。
关于.net - Thread.CurrentThread.CurrentUICulture 和 CultureInfo.CurrentUICulture 是否始终同步?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25304864/
在 .NET 应用程序中,您似乎可以通过以下方式获取或设置当前 (UI) 区域性 System.Threading.Thread.CurrentThread.CurrentUICulture 或通过
Windows 7 区域和语言对话框中的各种设置为 CurrentCulture 对象的属性提供值。然而,WPF控件似乎改用CurrentUICulture,导致完全无法尊重用户的偏好。 例如,在我的
我正在使用 CurrentUICulture 进行本地化。在不同的线程中查询 UI Culture 之前,这工作得很好。所以我的问题是如何修复 CurrentUICulture 以便在我创建新线程时它
我正在尝试更改我的 WPF 应用程序在点击事件中使用的语言,但它没有改变。 private void menuItemGerman_Click(object sender, RoutedEventAr
我有一个 asp.net mvc 应用程序,我希望用户能够更改语言。我提供了一系列带有小标志的链接,让用户选择语言。所有这些链接的目标是我的“仪表板”页面,其中 Controller 有以下代码: [
我的 MVC 项目中有以下两个文件: 我像这样在我的 global.asax 中设置文化: Thread.CurrentThread.CurrentUICulture = new CultureInf
我一直在搜索如何更改具有 Localizable 的表单的语言属性设置为 true。 https://msdn.microsoft.com/en-us/library/system.threading
据我了解,默认情况下,报表查看器的语言由 "CultureInfo.InstalledUICulture" 设置(不是那么简单)。这意味着,如果我的计算机来自巴西,那么它将使用巴西的文化来格式化数字。
我正在尝试找出程序的语言并为该语言更改我的字符串 CultureInfo culture = new CultureInfo("en"); CultureInfo currentCulture = T
我正在使用 C# 开发 SL5 应用程序,我希望将其国际化。我发现以下设置 UI 文化: var culture = new CultureInfo(Thread.CurrentThread.Curr
我试图在运行时设置应用程序的 CurrentUICulture。但是,我的表单中的菜单项保持不变。除了更改 CurrentUICulture 之外,我还需要做一些额外的事情吗? 最佳答案 聚会又迟到了
我有一个使用 .NET 3.5 框架的基于 WinForms 的应用程序。该应用程序具有某些资源的本地化版本。 当我在运行 Windows XP 副本的机器上运行该应用程序时,该副本最初安装时使用 e
我正在阅读一个资源,它说: CurrentUICulture must be set at the startup of a application. 对于 ASP.NET 网页,我应该在哪里适本地设
我正在用两种语言开发一个多语言网站,从阿拉伯语和英语开始 我已经在 IE 和 FireFox 中将语言设置为阿拉伯语 (ar-ae),但它总是给我英语版本,我无法解决这个问题 网站结构 Default
所以,我有一些本地化的资源文件。它们是可以格式化的字符串。 例如: MyResource.resx Title: "MyApp - Ver: {0}" 然后我这样返回它: public String
我正在一个小型测试 WPF 应用程序中进行本地化,并且想要英语和法语。我创建了 Resources.en-CA.resx 和 Resources.fr-CA.resx。 当我的测试应用程序启动时,我有
我正在尝试让我的应用程序支持多种语言。例如,我制作了一些附属程序集,现在我想测试应用程序在法国机器上运行时的外观。 在[控制面板->区域和语言选项]中,我可以在区域选项选项卡中选择法语(法国),在高级
CurrentCulture有什么区别, InvariantCulture , CurrentUICulture和 InstalledUICulture来自 System.Globalization.
我使用 .NET 3.5(网站项目)在 ASP.NET 中编写了页面。 我想使用 jQuery 添加一些特定于文化的验证器到我的页面。 我受伤了关于使用 Globalize 插件的很好的教程:http
我正在处理一个 ASP.NET Web API 项目,在该项目中我遇到了一个问题,其中子项 Task异步运行的 s 不继承父线程的当前文化;即,即使在设置了 Thread.CurrentThread.
我是一名优秀的程序员,十分优秀!