各位好,最近看了一些Whois 查询的代码.
下面就是我在网上找的代码,用Whois.networksolutions.com查询.COM域名信息,试了几个比较出名可以查出来,像sina.com,163.com可以.但是很多.COM域名都查不了啊,可都是.COM的域名啊.
public class WhoisLookup
{
    public static bool Query(string strDomain, out   string strWhoisInfo)
    {
        const int BUFFER_SIZE = 128;
        if ("" == strDomain)
            throw new ArgumentException("You   must   specify   a   domain   name.");
        TcpClient tcpc = new TcpClient();
        strWhoisInfo = "N/A";
        //   企图连接   whois     服务器
        try
        {
            tcpc.Connect("whois.networksolutions.com", 43);
        }
        catch
        {
            return false;
        }
        //   获取流
        Stream s = tcpc.GetStream();
        //   发送请求
        strDomain += "\r\n";
        Byte[] bDomArr = Encoding.ASCII.GetBytes(strDomain.ToCharArray());
        s.Write(bDomArr, 0, strDomain.Length);
        Byte[] Buffer = new Byte[BUFFER_SIZE];
        StringBuilder strWhoisResponse = new StringBuilder("");
        int BytesRead = s.Read(Buffer, 0, BUFFER_SIZE);
        while (BytesRead != 0)
        {
           strWhoisResponse.Append(Encoding.ASCII.GetString(Buffer, 0, BytesRead));
            BytesRead = s.Read(Buffer, 0, BUFFER_SIZE);
        }
       tcpc.Close();
        strWhoisInfo = strWhoisResponse.ToString();
        return true;
    }
}用"whois.networksolutions.com"这个是可以查询,但是很多已注册的域名为什么都查询不了呢,像163.com,sina.com几个可以查询,而像tom.com,useintel.com,qq.com等域名的注册信息却查不出来,可是这都是.COM的域名怎么都查不出来呢,这个是什么原因呢,而且在www.networksolutions.com上却都可以查得到注册信息.这个是怎么回事啊,而且像一些虚拟主机的都是怎么查询的啊.既然Whois.networksolutions.com可以查询.COM域名注册信息,为什么很的又查出来啊.
哪位老兄 大哥可以给我讲进啊,应该怎么修改啊.