函数参考


_WinAPI_GetGeoInfo

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 值.

注意/说明

None

相关

详情参考

在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)