• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

VB.NET CultureInfo.CurrentUICulture属性代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了VB.NET中System.Globalization.CultureInfo.CurrentUICulture属性的典型用法代码示例。如果您正苦于以下问题:VB.NET CultureInfo.CurrentUICulture属性的具体用法?VB.NET CultureInfo.CurrentUICulture怎么用?VB.NET CultureInfo.CurrentUICulture使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在System.Globalization.CultureInfo的用法示例。



在下文中一共展示了CultureInfo.CurrentUICulture属性的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的VB.NET代码示例。

示例1: Example

' 导入命名空间
Imports System.Globalization
Imports System.Threading

Public Module Example
   Public Sub Main()

      ' Display the name of the current thread culture.
      Console.WriteLine("CurrentCulture is {0}.", CultureInfo.CurrentCulture.Name)

      ' Change the current culture to th-TH.
      CultureInfo.CurrentCulture = New CultureInfo("th-TH", False)
      Console.WriteLine("CurrentCulture is now {0}.", CultureInfo.CurrentCulture.Name)

      ' Display the name of the current UI culture.
      Console.WriteLine("CurrentUICulture is {0}.", CultureInfo.CurrentUICulture.Name)

      ' Change the current UI culture to ja-JP.
      CultureInfo.CurrentUICulture = New CultureInfo("ja-JP", False)
      Console.WriteLine("CurrentUICulture is now {0}.", CultureInfo.CurrentUICulture.Name)
   End Sub 
End Module
开发者ID:VB.NET开发者,项目名称:System.Globalization,代码行数:22,代码来源:CultureInfo.CurrentUICulture

输出:

CurrentCulture is en-US.
CurrentCulture is now th-TH.
CurrentUICulture is en-US.
CurrentUICulture is now ja-JP.


示例2: Example

' 导入命名空间
Imports System.Collections.Generic
Imports System.Globalization
Imports System.Runtime.Versioning
Imports System.Threading
Imports System.Threading.Tasks

<assembly:TargetFramework(".NETFramework,Version=v4.6")>

Module Example
   Public Sub Main()
      Dim tasks As New List(Of Task)
      Console.WriteLine("The current UI culture is {0}", 
                        Thread.CurrentThread.CurrentUICulture.Name)
      Thread.CurrentThread.CurrentUICulture = New CultureInfo("pt-BR")
      ' Change the current UI culture to Portuguese (Brazil).
      Console.WriteLine("Current culture changed to {0}",
                        Thread.CurrentThread.CurrentUICulture.Name)
      Console.WriteLine("Application thread is thread {0}",
                        Thread.CurrentThread.ManagedThreadId)
      ' Launch six tasks and display their current culture.
      For ctr As Integer = 0 to 5
         tasks.Add(Task.Run(Sub()
                               Console.WriteLine("Culture of task {0} on thread {1} is {2}",
                                                 Task.CurrentId, 
                                                 Thread.CurrentThread.ManagedThreadId,
                                                 Thread.CurrentThread.CurrentUICulture.Name)
                            End Sub))                     
      Next
      Task.WaitAll(tasks.ToArray())
   End Sub
End Module
开发者ID:VB.NET开发者,项目名称:System.Globalization,代码行数:32,代码来源:CultureInfo.CurrentUICulture

输出:

The current culture is en-US
Current culture changed to pt-BR
Application thread is thread 9
Culture of task 2 on thread 11 is pt-BR
Culture of task 1 on thread 10 is pt-BR
Culture of task 3 on thread 11 is pt-BR
Culture of task 5 on thread 11 is pt-BR
Culture of task 6 on thread 11 is pt-BR
Culture of task 4 on thread 10 is pt-BR


示例3: Main

' 导入命名空间
Imports System.Globalization

Module Example
   Public Sub Main()
      Dim culture As CultureInfo = CultureInfo.CurrentCulture
      Console.WriteLine("The current UI culture is {0} [{1}]",
                        culture.NativeName, culture.Name)
   End Sub
End Module
开发者ID:VB.NET开发者,项目名称:System.Globalization,代码行数:10,代码来源:CultureInfo.CurrentUICulture

输出:

The current UI culture is English (United States) [en-US]


示例4: Example

' 导入命名空间
Imports System.Globalization
Imports System.Threading

Module Example
   Public Sub Main()
      Console.WriteLine("The current UI culture: {0}", 
                        CultureInfo.CurrentUICulture.Name)
      
      CultureInfo.CurrentUICulture = CultureInfo.CreateSpecificCulture("fr-FR")
      Console.WriteLine("The current UI culture: {0}", 
                        CultureInfo.CurrentUICulture.Name)
   End Sub
End Module
开发者ID:VB.NET开发者,项目名称:System.Globalization,代码行数:14,代码来源:CultureInfo.CurrentUICulture

输出:

The current UI culture: en-US
The current UI culture: fr-FR



注:本文中的System.Globalization.CultureInfo.CurrentUICulture属性示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
VB.NET CultureInfo.InvariantCulture属性代码示例发布时间:2022-05-26
下一篇:
VB.NET SystemPens.GradientInactiveCaption属性代码示例发布时间:2022-05-26
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap