文字列からIPAddressの生成


001 using System.Net;
002
003 IPAddress IP;
004
005 try
006 {
007 IP = IPAddress.Parse("127.0.0.1");
008 }
009 catch (FormatException e)
010 { // IP アドレスのフォーマットが不正
011 }
012 catch (ArgumentNullException e)
013 { // null が指定された
014 }