detect os language from c#

后端 未结 7 1326
北荒
北荒 2020-12-06 01:32

Is there a way to detect the Language of the OS from within a c# class?

7条回答
  •  广开言路
    2020-12-06 01:43

    Unfortunately, the previous answers are not 100% correct.

    The CurrentCulture is the culture info of the running thread, and it is used for operations that need to know the current culture, but not do display anything. CurrentUICulture is used to format the display, such as correct display of the DateTime. Because you might change the current thread Culture or UICulture, if you want to know what the OS CultureInfo actually is, use CultureInfo.InstalledUICulture.

    Also, there is another question about this subject (more recent than this one) with a detailed answer:

    Get operating system language in c#.

提交回复
热议问题