开发者

Domain checker (Whois)?

to all. i developing a webpage using asp.net with c# language, in this webpage i have a textbox for taking url of the domain and button. when user enter domain name in the textbox and press the button the details of the domain will displaying in the other window. i take help from stackoverflow user and i get the code it is working fine, but when i type the domain name particularly ".in" doamins are not giving details. simply domain available message is displaying actually the domain is registered for example i tried "axisbank.co.in" in my page it is displaying the domain is available but actually it is already taken. I am sending my code please help me ( particularly .in domain names)

protected void Button1_Click(object sender, EventArgs e)
{
    lblDomainName.Text = Session["WhoIs"].ToString();
    string firstLevelbufData = null;
    // Stores the bufData extracted from the webclient 
    try
    {
        // similarly we can select any server address for bufData mining
        string strURL = "http://www.directnic.com/whois/index.php?query=" + txtDomain.Text;
        WebClient web = new WebClient();
        // byte array to store the extracted bufData by开发者_JS百科 webclient
        byte[] bufData = null;
        bufData = web.DownloadData(strURL);
        // got the bufData now convert it into string form
        firstLevelbufData = Encoding.Default.GetString(bufData);
    }
    catch (System.Net.WebException ex)
    {
        // this exception will be fired when the host name is not resolved or any other connection problem
        //txtResult.Text = ex.Message.ToString();//sasi
        lblresult.Text = ex.Message.ToString();
        return;
    }
    try
    {
        // first and last are the regular expression string for extraction bufData witnin two tags
        // you can change according to your requirement
        string first = null;
        string last = null;
        // chr(34) is used for (") symbol
        first = "<p class=\"text12\">";
        last = "</p>";

        Regex RE = new Regex(first + "(?<MYDATA>.*?(?=" + last + "))", RegexOptions.IgnoreCase | RegexOptions.Singleline);
        // try to extract the bufData  within the first and last tag
        Match m = RE.Match(firstLevelbufData);
        // got the result
        //txtResult.Text = m.Groups["MYDATA"].Value + "<br>";//sasi
        lblresult.Text = m.Groups["MYDATA"].Value + "<br>";
        // check if no information abour that domain is available
        //if (txtResult.Text.Length < 10) txtResult.Text = "Domain "+ txtDomain .Text +" is Available";//sasi
        if (lblresult.Text.Length < 10)

            lblresult.Text = "Domain " +  txtDomain.Text + " is Available";
    }
    catch (System.Net.WebException ex)
    {
        lblresult.Text = " Sorry the  information is currently not available !! ";
    } 

}

help me thank you


http://www.directnic.com does not have information about .co.in domain names. Most of the whois sites won't allow you to fetch the results before filling in CAPTCHA.

http://registry.in/ is the official registry, try using whois protocol at whois.registry.in

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜