http://web.cncode.com/SoftView.Asp?SoftID=1323

解决方案 »

  1.   

    http://web.cncode.com/SoftView.Asp?SoftID=47
      

  2.   

    用正则表达式分析获得的XML文件
      

  3.   

    通过别的网站的查询功能来完成你的查询
    你只要提供查询参数
      Dim firstLevelbufData As String ' Stores the bufData extracted from the webclient 
            Try
                ' similarly we can select any server address for bufData mining
                Dim strURL As String = "http://www.directnic.com/whois/index.php?query=" + txtDomain.Text
                Dim web As New WebClient()
                ' byte array to store the extracted bufData by webclient
                Dim bufData As Byte()
                bufData = web.DownloadData(strURL)
                ' got the bufData now convert it into string form
                firstLevelbufData = Encoding.Default.GetString(bufData)
                ' this exception will be fired when the host name is not resolved or any other connection problem
            Catch ex As System.Net.WebException
                txtResult.Text = ex.Message()
                Exit Sub
            End Try
            Try
                ' first and last are the regular expression string for extraction bufData witnin two tags
                ' you can change according to your requirement
                Dim first, last As String
                ' chr(34) is used for (") symbol
                first = "<p class=" + Chr(34) + "text12" + Chr(34) + ">"
                last = "</p>"
                Dim RE As New Regex(first + "(?<MYDATA>.*?(?=" + last + "))", RegexOptions.IgnoreCase Or RegexOptions.Singleline)
                ' try to extract the bufData  within the first and last tag
                Dim m As Match = RE.Match(firstLevelbufData)
                ' got the result
                txtResult.Text = m.Groups("MYDATA").Value + "<br>"
                ' check if no information abour that domain is available
                If txtResult.Text.Length < 10 Then txtResult.Text = "Information about this domain is not available !!"
            Catch e3 As Exception
                txtResult.Text = "Sorry the whois information is currently not available !!"
            End Try
      

  4.   

    不是查询的问题了,是在查询结果中如何判断域名是否已经被注册,在程序中判断呢,最好是c#的代码,显示给用户的只是注册和未被注册。
    其实到cnnic查询.cn和com.cn结果好办呢,如果没有就是no matching record,而查询其他域名则是英文一大篇,如何得到其中的No match for "xxx.COM".信息呢,可否在结果中查找这及格字符,该如何实现呢
      

  5.   

    其实这个问题很好解决了,如果是在cnnic查询的。cn或。com.cn域名没有的话显示结果是no match record,查询的国际域名没有注册也会显示no match for“你查询的域名”,只要在结果中查找有没有no match字符,就可以判断是否已经注册了