Página 1 de 1

GetCity GetCountry

Publicado: 27 Jul 2014, 18:00
por Pink
msgbox(0,"",GetCity() & "-" & GetCountry())

Func GetCountry()
	Local $sCountry=""
    $sCountry = RegRead("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation", "TimeZoneKeyName")
    Return StringRegExpReplace($sCountry," Standard Time","")
EndFunc


Func GetCity()
	Local $sCity=""
    $sCity= RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\" & GetCountry() & " Standard Time", "Display")
    Return StringMid($sCity,StringInStr($sCity," ")+1)
EndFunc

Saludos