UtilWebGeoLocate(String) Method
Estimates the real-world geographic location of a host name.
Namespace: DevCase.Core.Networking.CommonAssembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
public static GeoInfo GeoLocate(
string hostname
)
Public Shared Function GeoLocate (
hostname As String
) As GeoInfo
Dim hostname As String
Dim returnValue As GeoInfo
returnValue = UtilWeb.GeoLocate(hostname)
public:
static GeoInfo^ GeoLocate(
String^ hostname
)
static member GeoLocate :
hostname : string -> GeoInfo
No code example is currently available or this language may not be supported.
- hostname String
-
The host name to geolocate (eg. "http://google.com").
GeoInfo
A
GeoInfo instance that represents the geographic location info.
This is a code example.
No code example is currently available or this language may not be supported.
Dim gi As GeoInfo = GeoLocate("http://google.com")
Dim sb As New Global.System.Text.StringBuilder
With sb
.AppendLine(String.Format("Hostname....: {0}", gi.Hostname))
.AppendLine(String.Format("Ip Address..: {0}", gi.Ip))
.AppendLine(String.Format("Country Name: {0}", gi.CountryName))
.AppendLine(String.Format("Country Code: {0}", gi.CountryCode))
.AppendLine(String.Format("Region Name: {0}", gi.RegionName))
.AppendLine(String.Format("Region Code: {0}", gi.RegionCode))
.AppendLine(String.Format("City........: {0}", gi.City))
.AppendLine(String.Format("Postal Code.: {0}", gi.PostalCode))
.AppendLine(String.Format("Latitude....: {0}", gi.Latitude))
.AppendLine(String.Format("Longitude...: {0}", gi.Longitude))
End With
Console.WriteLine(sb.ToString())
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
HttpListenerException
|
The returned gegraphic location info is empty due to an unknown error.
or
The server cannot properly process the request. Please, ensure the host name or IP address is valid.
|