How to get current regional settings in C#?

前端 未结 7 1637
独厮守ぢ
独厮守ぢ 2020-11-29 08:32

Normally you can get it by writing something like

CultureInfo currentCulture = Thread.CurrentThread.CurrentCulture;

But this way you can only ge

相关标签:
7条回答
  • 2020-11-29 09:05

    You can use Win32 API function GetSystemDefaultLCID. The signiture is as follow:

    [DllImport("kernel32.dll")]
    static extern uint GetSystemDefaultLCID();
    

    GetSystemDefaultLCID function returns the LCID. It can map language string from the folowing table. Locale IDs Assigned by Microsoft

    0 讨论(0)
提交回复
热议问题