How to get current regional settings in C#?

前端 未结 7 1678
独厮守ぢ
独厮守ぢ 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

提交回复
热议问题