1
0
mirror of https://github.com/RaidMax/IW4M-Admin.git synced 2025-06-10 23:31:13 -05:00

Initial .net 6 upgrades

This commit is contained in:
RaidMax
2022-01-26 10:32:16 -06:00
parent 513f0afd34
commit 6f6dd035ee
170 changed files with 2805 additions and 2577 deletions

View File

@ -6,6 +6,7 @@ using SharedLibraryCore.Database.Models;
using System.Linq;
using Microsoft.EntityFrameworkCore;
using System.Net;
using System.Net.Http;
using Newtonsoft.Json.Linq;
using Humanizer;
using Data.Abstractions;
@ -105,11 +106,11 @@ namespace IW4MAdmin.Plugins.Welcome
/// <returns></returns>
private async Task<string> GetCountryName(string ip)
{
using var wc = new WebClient();
using var wc = new HttpClient();
try
{
var response =
await wc.DownloadStringTaskAsync(new Uri($"http://extreme-ip-lookup.com/json/{ip}?key=demo"));
await wc.GetStringAsync(new Uri($"http://extreme-ip-lookup.com/json/{ip}?key=demo"));
var responseObj = JObject.Parse(response);
response = responseObj["country"]?.ToString();
@ -124,4 +125,4 @@ namespace IW4MAdmin.Plugins.Welcome
}
}
}
}
}