I want to add ip license in my application to do this, I get the user's ip address and compare it with the list of ip addresses on my website. However, my codes take all the ip addresses in the list, so the output always returns false.
I assigned the user's IP address to a variable and compared it to the ip address query result. It works this way, but I want to manage the ip address list from a web address.
var webClient = new System.Net.WebClient();
string dnsString = webClient.DownloadString("http://checkip.dyndns.org");
dnsString = (new Regex(@"\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b")).Match(dnsString).Value;
string userip = webClient.DownloadString("http://35.234.83.224/test.php");
userip = (new Regex(@"\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b")).Match(userip).Value;
webClient.Dispose();
(My Website) IP List:
192.168.1.1
192.168.1.2
192.168.1.3
My application output (User ip: 192.168.1.1):
Output: 192.168.1.1192.168.1.2192.168.1.3 - User IP Address did not match!