Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

c# get pc ip address

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!");
}
Comment

PREVIOUS NEXT
Code Example
Csharp :: .net core temp directory 
Csharp :: disappear after time unity 
Csharp :: unity reset rigidbody velocity 
Csharp :: c# save bytes array to file 
Csharp :: c# remove crlf from string 
Csharp :: C# get pc language 
Csharp :: unity mouse position to world 
Csharp :: fade text unity 
Csharp :: how to get the current gameobject animator in unity 
Csharp :: iso date format c# 
Csharp :: blazor get current url 
Csharp :: unity coroutine 
Csharp :: c# get free space on drive 
Csharp :: c# how to simulate mouse click 
Csharp :: Linq - Random Elements 
Csharp :: linq unique count property 
Csharp :: unity c# instantiate prefab 
Csharp :: get request url in asp.net core 
Csharp :: C# save pdf stream to file 
Csharp :: unity look at 2d 
Csharp :: unity rotate gameobject 90 degrees 
Csharp :: generate random number c# 
Csharp :: c# get first 5 characters of string 
Csharp :: substring c# after character 
Csharp :: how to append a new line in a txt file c# 
Csharp :: how to create a new folder with c# 
Csharp :: how to update a project to cross target .net core 
Csharp :: how to get all panels in form in c# 
Csharp :: get random from list c# 
Csharp :: convert int array to string in C# 
ADD CONTENT
Topic
Content
Source link
Name
1+3 =