Display program usage.Ĭonsole::WriteLine( "Please enter an IP address." ) Ĭonsole::WriteLine( "Usage: >ipaddress_isloopback any IPv4 or IPv6 address." ) Ĭonsole::WriteLine( "Example: >ipaddress_isloopback 127.0.0.1" ) Ĭonsole::WriteLine( "Example: >ipaddress_isloopback 0:0:0:0:0:0:0:1" ) LoopBack = String::Concat( " is an IPv4 loopback address whose internal format is: ", address, "." ) Ĭonsole::WriteLine( "Your input address: \" ", e->Message ) Īrray^args = Environment::GetCommandLineArgs() If ( IPAddress::IsLoopback( address ) & address->AddressFamily = AddressFamily::InterNetwork )
LoopBack = String::Concat( " is an IPv6 loopback address whose internal format is: ", address, "." )
If ( IPAddress::IsLoopback( address ) & address->AddressFamily = AddressFamily::InterNetworkV6 ) Perform semantic check by verifying that the address is a valid IPv4 IPAddress^ address = IPAddress::Parse( ipAddress ) Perform syntax check by parsing the address string entered by the user. String^ loopBack = " is not a loopback address." Then it checks whether it represents a loopback address. passed ipAddress parameter is in the correct format. This method calls the IPAddress::Parse method to check if the
#What is a loopback address code#
The following code example uses the IsLoopback method to determine whether the specified address is a loopback address. True if address is the loopback address otherwise, false.