Retrieves information about a specified geographical location.
#Include <WinAPIEx.au3>
_WinAPI_GetGeoInfo ( $GEOID, $iType [, $iLanguage] )
$GEOID | The identifier for the geographical location (GEOID) for which to get information. |
$iType | The type of information to retrieve. It can be one of the following values. $GEO_NATION $GEO_LATITUDE $GEO_LONGITUDE $GEO_ISO2 $GEO_ISO3 $GEO_LCID $GEO_FRIENDLYNAME $GEO_OFFICIALNAME $GEO_TIMEZONES $GEO_OFFICIALLANGUAGES Windows Vista or later $GEO_RFC1766 Windows 8 or later $GEO_ISO_UN_NUMBER $GEO_PARENT |
$iLanguage | [可选参数] The language identifier, used with the geographical location. |
成功: | 返回 1. |
失败: | 返回 0 并设置 @error 标志为非 0 值. |
在MSDN中搜索
#Include <APIConstants.au3>
#Include <WinAPIEx.au3>
Opt('MustDeclareVars', 1)
Global $ID = _WinAPI_GetUserGeoID()
ConsoleWrite('ID: 0x' & Hex($ID) & @CR)
ConsoleWrite('Latitude: ' & _WinAPI_GetGeoInfo($ID, $GEO_LATITUDE) & @CR)
ConsoleWrite('Longitude: ' & _WinAPI_GetGeoInfo($ID, $GEO_LONGITUDE) & @CR)
ConsoleWrite('Name: ' & _WinAPI_GetGeoInfo($ID, $GEO_FRIENDLYNAME) & @CR)
ConsoleWrite('ISO code: ' & _WinAPI_GetGeoInfo($ID, $GEO_ISO3) & @CR)