networking

Network Utility Methods Part 2: Retrieving Local and Public IP Addresses (C# .NET Core)

Let’s finish off the NetworkUtilities class from the previous post with a set of methods that retrieve the private (local) and public (external) IP addresses of the local machine. All source files can be downloaded individually as .cs files or as a single zip file containing the entire class at the gist link below: Network Utilities: IP Parsing/Retrieving (C# .NET Core 2.0) [gist.github.com] Retrieve Local IP Address (Requires Internet) The method below, GetLocalIPv4AddressRequiresInternet, retrieves the local IP address, and does so in a fairly clever way (IMHO).... Read More

Network Utility Methods Part 1: Parsing IP Addresses, Handling CIDR Ranges and Netmasks (C# .NET Core 2.0)

While creating the TPL Socket extension methods, I ended up with a library of networking functions and IP address parsing/retrieving methods. If you would like to download individual .cs files or a zip file containing the entire library, you can do so at the github link below: Network Utilities: IP Parsing/Retrieving (C# .NET Core 2.0) [gist.github.com] This library targets the .NET Core 2.0 framework and therefore can be used on Windows, MacOS and any Linux system where the framework is installed.... Read More