C# - Gets the whois information.

By , 11/3/2007
(1 ratings)
Gets the whois information.
Translate to VB
/// <summary>
/// Gets the whois information.
/// </summary>
/// <param name="whoisServer">The whois server.</param>
/// <param name="url">The URL.</param>
/// <returns></returns>
private string GetWhoisInformation(string whoisServer, string url)
{
    StringBuilder stringBuilderResult = new StringBuilder();
    TcpClient tcpClinetWhois = new TcpClient(whoisServer, 43);
    NetworkStream networkStreamWhois = tcpClinetWhois.GetStream();
    BufferedStream bufferedStreamWhois = new BufferedStream(networkStreamWhois);
    StreamWriter streamWriter = new StreamWriter(bufferedStreamWhois);

    streamWriter.WriteLine(url);
    streamWriter.Flush();

    StreamReader streamReaderReceive = new StreamReader(bufferedStreamWhois);

    while (!streamReaderReceive.EndOfStream)
        stringBuilderResult.AppendLine(streamReaderReceive.ReadLine());

    return stringBuilderResult.ToString();
}
Tagged with WHOIS, IP, Internet, www, Server, tcp.

1 Comments

By tanvi, 6/8/2013
I want create a website to check whether domain exist or not.How can i do this?
 

Log in, to comment!