mirror of
https://github.com/bloxstraplabs/bloxstrap.git
synced 2025-04-21 10:01:27 -07:00
Requested Changes
This commit is contained in:
parent
11386b93b4
commit
f81cedbf2a
@ -282,9 +282,11 @@
|
|||||||
|
|
||||||
string location, locationCity, locationRegion, locationCountry = "";
|
string location, locationCity, locationRegion, locationCountry = "";
|
||||||
|
|
||||||
|
IPInfoResponse locationInformation
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
locationInformation = await Http.GetJson<IPInfoResponse>($"https://ipinfo.io/{ActivityMachineAddress}/json");
|
IPInfoResponse locationInformation = await Http.GetJson<IPInfoResponse>($"https://ipinfo.io/{ActivityMachineAddress}/json");
|
||||||
|
|
||||||
locationCity = locationInformation.IP;
|
locationCity = locationInformation.IP;
|
||||||
locationRegion = locationInformation.Region;
|
locationRegion = locationInformation.Region;
|
||||||
|
@ -3,33 +3,12 @@ namespace Bloxstrap.Models
|
|||||||
public class IPInfoResponse
|
public class IPInfoResponse
|
||||||
{
|
{
|
||||||
[JsonPropertyName("city")]
|
[JsonPropertyName("city")]
|
||||||
public string City { get; set; }
|
public string? City { get; set; }
|
||||||
|
|
||||||
[JsonPropertyName("country")]
|
[JsonPropertyName("country")]
|
||||||
public string Country { get; set; }
|
public string? Country { get; set; }
|
||||||
|
|
||||||
[JsonPropertyName("region")]
|
[JsonPropertyName("region")]
|
||||||
public string Region { get; set; }
|
public string? Region { get; set; }
|
||||||
|
|
||||||
[JsonPropertyName("ip")]
|
|
||||||
public string IP { get; set; }
|
|
||||||
|
|
||||||
[JsonPropertyName("postal")]
|
|
||||||
public string Postal { get; set; }
|
|
||||||
|
|
||||||
[JsonPropertyName("timezone")]
|
|
||||||
public string TimeZone { get; set; }
|
|
||||||
|
|
||||||
[JsonPropertyName("readme")]
|
|
||||||
public string ReadME { get; set; }
|
|
||||||
|
|
||||||
[JsonPropertyName("org")]
|
|
||||||
public string Org { get; set; }
|
|
||||||
|
|
||||||
[JsonPropertyName("loc")]
|
|
||||||
public string Loc { get; set; }
|
|
||||||
|
|
||||||
[JsonPropertyName("anycast")]
|
|
||||||
public string AnyCast { get; set; }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user