求不封IP,不限次数的域名注册API查询接口。附万网批量查询接口及源码!
huayy 2011-08-20 12:39:59 昨天晚上做了一套通过万网API查询域名的程序,但是每当查询100个左右的时候,就要换IP才能继续查询。
比较麻烦,求更好的API地址!
即“http://panda.www.net.cn/cgi-bin/check.cgi?area_domain=" & dname”
这样的地址,要不限查询次数的。
附WINFORM代码
Dim Td As System.Threading.Thread '定义一个线程
Dim n As Int32
Sub search()
Try
Dim tb As New Data.DataTable
tb = code.Data_DataTable("select a_ci,id from a_ci where a_class = '0' order by newid()").Tables(0)
Dim i As Integer
For i = 0 To tb.Rows.Count - 1
Dim c As String
Dim dname = tb.Rows.Item(i).Item("a_ci") & ".com"
Dim regurl = "http://panda.www.net.cn/cgi-bin/check.cgi?area_domain=" & dname
Dim reghtml As String = LoadURLData(regurl)
If GetKey(reghtml, "<returncode>", "</returncode>") <> "200" And GetKey(reghtml, "<original>", "</original>") <> "211 : Domain name is invalid" And GetKey(reghtml, "<original>", "</original>") <> "210 : Domain name is available" Then
c = "格式错误"
Else
If GetKey(reghtml, "<original>", "</original>") = "211 : Domain name is not available" Then
c = "已经注册"
ElseIf GetKey(reghtml, "<original>", "</original>") = "210 : Domain name is available" Then
c = "可以注册"
Else
c = GetKey(reghtml, "<original>", "</original>")
End If
End If
code.Data_update("update [a_ci] set a_class='" & c & "' where ID=" & tb.Rows.Item(i).Item("id"))
If c = "可以注册" Then
ListBox1.Items.Add(dname)
Dim q3 As Integer = Label3.Text
Label3.Text = q3 + 1
Else
Dim q2 As Integer = Label2.Text
Label2.Text = q2 + 1
End If
Dim q1 As Integer = Label1.Text
Label1.Text = q1 - 1
Next
Catch ex As Exception
ListBox1.Items.Add(ex.ToString)
End Try
End Sub
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Try
Label1.Text = code.Data_count("select count(id) from a_ci where a_class='0'")
Label2.Text = code.Data_count("select count(id) from a_ci where a_class='已经注册'")
Label3.Text = code.Data_count("select count(id) from a_ci where a_class='可以注册'")
Catch ex As Exception
ListBox1.Items.Add(ex.ToString)
End Try
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Try
Td = New System.Threading.Thread(AddressOf search) '实例化,指向abc过程
Td.Start() '开始运行线程
Catch ex As Exception
ListBox1.Items.Add(ex.ToString)
End Try
End Sub
Public Function LoadURLData(ByVal url As String) As String
Dim request As System.Net.HttpWebRequest = DirectCast(System.Net.HttpWebRequest.Create(url), System.Net.HttpWebRequest)
Dim response As System.Net.HttpWebResponse = DirectCast(request.GetResponse(), System.Net.HttpWebResponse)
Dim reader As New System.IO.StreamReader(response.GetResponseStream(), System.Text.Encoding.GetEncoding("gb2312"))
Return reader.ReadToEnd()
End Function
Function GetKey(ByVal HTML, ByVal Start, ByVal Last)
Dim body1 = Split(HTML, Start)
Dim body2 = Split(body1(1), Last)
GetKey = body2(0)
End Function
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
End
End Sub
End Class