Horje
how to get ip address in c# Code Example
how to get ip address in c#
public static string GetLocalIPAddress()
{
    var host = Dns.GetHostEntry(Dns.GetHostName());
    foreach (var ip in host.AddressList)
    {
        if (ip.AddressFamily == AddressFamily.InterNetwork)
        {
            return ip.ToString();
        }
    }
    throw new Exception("No network adapters with an IPv4 address in the system!");
}
c# get ip address
var httpClient = new HttpClient();
var ip = await httpClient.GetStringAsync("https://api.ipify.org");
Console.WriteLine($"My public IP address is: {ip}");
Source: ipify.org




Csharp

Related
unity how to get y value Code Example unity how to get y value Code Example
c# delete files older than 10 days Code Example c# delete files older than 10 days Code Example
c# get executable path Code Example c# get executable path Code Example
Point to mouse 2D Unity Code Example Point to mouse 2D Unity Code Example
how t remove a component in unity Code Example how t remove a component in unity Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
11