示例#1
0
 public void BadServerPort()
 {
     Assert.Throws <ArgumentOutOfRangeException>(delegate
     {
         _whois.Query("example.com", BadPortServer);
     });
 }
示例#2
0
        private static int RunWhois(Options o)
        {
            var whois = new YaWhoisClient();

            whois.WhenResponseParsed += Whois_ResponseParsed;

            if (o.UseIANA)
            {
                o.Server = "whois.iana.org";
            }

            try
            {
                whois.Query(o.Object, o.Server, o.Verbose);
                return(0);
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
                return(2);
            }
        }