http://web.cncode.com/SoftView.Asp?SoftID=1323
解决方案 »
- .NET,src,href正则匹配问题
- vs2005中报表如何做
- .NET创建控件时出错
- 关于在datalist中动态添加hyperlink的问题
- 在gridview中插入DropDownList列,怎样在OnSelectedIndexChanged 事件中获取获取所在行的rowindex呢
- asp.net 调试运行的时候,出现该页无法显示的情况
- 请问各位用什软件来写开发文档比较好?
- 安装程序
- *************************请问关于xml节点查询的问题**************
- 询求解决方法?
- 在线等待,为什么datagridcolumn的headertext取不出来
- 最后20分问同一个问题,请大家看看啊
你只要提供查询参数
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
其实到cnnic查询.cn和com.cn结果好办呢,如果没有就是no matching record,而查询其他域名则是英文一大篇,如何得到其中的No match for "xxx.COM".信息呢,可否在结果中查找这及格字符,该如何实现呢