Reading the regional location setting (country code) in Windows using Ruby?
问题 I am trying to access the Control Panel: Region and Language: Location: Current location setting using Ruby. I am only interested in the country code. The closest I have got is the country code from the System Locale but that is not quite what I was after. `systeminfo | findstr /B /C:"System Locale"`.to_s.upcase.strip[30..31] I hope that someone out there might know. Thanks. 回答1: Using the Win32 API: require 'Win32API' # Set up some Win32 constants GEOCLASS_NATION = 16 GEO_ISO2 = 4 GEO