示例#1
0
文件: Host.cs 项目: MGanchkov/Chat
 public static bool TryParse(string text, out Host host)
 {
     string[] t = text.Split(':');
     if ((t.Length == 2) && IP.TryParse(t[0], out IP ip) && int.TryParse(t[1], out int port))
     {
         host = new Host(ip, port);
         return(true);
     }
     else
     {
         host = Host.None(0);
         return(false);
     }
 }
示例#2
0
 public static bool TryParse(JIP j, out IP sid) => IP.TryParse(j, out sid);