IP Address Parser
In this chapter you will learn:
Create IP address from String
The IPAddress
class in the
System.Net
namespace represents
an address in protocol.
It has a constructor accepting a byte array, and a
static Parse
method accepting a correctly formatted string:
using System;/*from j a va2 s .c o m*/
using System.Net;
class MainClass
{
public static void Main()
{
IPAddress test1 = IPAddress.Parse("192.168.1.1");
Console.WriteLine(test1);
}
}
The code above generates the following result.
Next chapter...
What you will learn in the next chapter:
- What is the Loopback IP Address
- What is the Broadcast IP Address
- What is Any IP Address
- What is the None IP Address
Home » C# Tutorial » Network