How it works...

In steps 1 to 11, we added a blank solution and added a .NET Standard 2.0 class library to the solution. In these steps, we have given proper names to the solution and the project. Then, in step 12 we changed the name of the default Class1.cs generated from Visual Studio. In step 15, we added the required using directive to the code. We have mainly used System.Net and System.Net.Sockets to access the required classes and read the IP address, and then added the System.Collecitons.Generic namespace to create a generic string List to hold the IP addresses.

In step 16, we added a public method that will read all the available IP addresses of the local machine you are on. In the first line, we stored the host name of the system ...

Get .NET Standard 2.0 Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.