public void DownloadTldsAsSamples() { var lines = File.ReadAllLines(@"..\..\Data\tlds.txt"); var serverLookup = new IanaServerLookup(); serverLookup.TcpReaderFactory = new TcpReaderFactory(); foreach (var line in lines) { if (string.IsNullOrEmpty(line)) { continue; } if (line.StartsWith("#")) { continue; } var fileName = @"..\..\..\Whois.Tests\Samples\Tlds\" + line.ToLower() + ".txt"; if (File.Exists(fileName)) { continue; } var tld = serverLookup.Lookup(line.ToLower()) as WhoisServerRecord; File.WriteAllText(fileName, tld.RawResponse); Console.WriteLine("{0}: {1:####,##0} byte(s)", line.ToLower(), tld.RawResponse.Length); Thread.Sleep(60000); } }
/// <summary> /// Initializes a new instance of the <see cref="WhoisLookup"/> class with the given <see cref="WhoisOptions"/>. /// </summary> public WhoisLookup(WhoisOptions options) { Options = options; whoisParser = new WhoisParser(); TcpReader = new TcpReader(); ServerLookup = new IanaServerLookup(TcpReader); }
public void SetUp() { lookup = new IanaServerLookup { TcpReaderFactory = new TcpReaderFactory() }; }
public void SetUp() { lookup = new IanaServerLookup(); }
/// <summary> /// Initializes a new instance of the <see cref="WhoisServerVisitor"/> class. /// </summary> /// <param name="encoding">The encoding used to read and write strings.</param> public WhoisServerVisitor(Encoding encoding) { WhoisServerLookup = new IanaServerLookup(); Encoding = encoding; }