IW4M-Admin/WebfrontCore/Application/Misc/VPNCheck.cs
2018-03-09 02:01:12 -06:00

29 lines
772 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace WebfrontCore.Application.Misc
{
public class VPNCheck
{
public static async Task<bool> UsingVPN(string ip)
{
try
{
using (var RequestClient = new System.Net.Http.HttpClient())
{
string response = await RequestClient.GetStringAsync($"http://check.getipintel.net/check.php?ip={ip}&contact=raidmax@live.com");
double probability = Convert.ToDouble(response);
return probability > 0.9;
}
}
catch (Exception)
{
return false;
}
}
}
}