 |
|
(asp.net whois check domain) ขอ code asp.net เชคโดเมน ด้วยครับ ว่าโดเมนนั้น ๆ มีผู้จดทะเบียนใช้ไปหรือยังครับ |
|
 |
|
|
 |
 |
|
Code (VB.NET)
<% @Page Language="VB" %>
<% @Assembly Name="System.Net" %>
<% @Import Namespace="System.Net.Sockets" %>
<% @Import Namespace="System.Text" %>
<% @Import Namespace="System.IO" %>
<%
Dim tcpc As New TCPClient()
If 0 = tcpc.Connect("whois.networksolutions.com", 43) Then
Dim strDomain As [String] = "microsoft.com" + ControlChars.Cr + ControlChars.Lf
Dim arrDomain As [Byte]() = Encoding.ASCII.GetBytes(strDomain.ToCharArray())
Dim s As Stream = tcpc.GetStream()
s.Write(arrDomain, 0, strDomain.Length)
Dim sr As New StreamReader(tcpc.GetStream(), Encoding.ASCII)
While - 1 <> sr.Peek()
Response.Write((sr.ReadLine() + "<br>"))
End While
tcpc.Close()
Else
Response.Write("Could not connect to WHOIS server!")
End If
%>
|
 |
 |
 |
 |
Date :
2011-02-10 06:23:14 |
By :
- |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
Code (C#)
<% @Page Language="C#" %>
<% @Assembly Name="System.Net" %>
<% @Import Namespace="System.Net.Sockets" %>
<% @Import Namespace="System.Text" %>
<% @Import Namespace="System.IO" %>
TCPClient tcpc = new TCPClient();
if (0 == tcpc.Connect("whois.networksolutions.com", 43)) {
String strDomain = "microsoft.com" + ControlChars.Cr + ControlChars.Lf;
Byte[] arrDomain = Encoding.ASCII.GetBytes(strDomain.ToCharArray());
Stream s = tcpc.GetStream();
s.Write(arrDomain, 0, strDomain.Length);
StreamReader sr = new StreamReader(tcpc.GetStream(), Encoding.ASCII);
while (-1 != sr.Peek()) {
Response.Write((sr.ReadLine() + "<br>"));
}
tcpc.Close();
} else {
Response.Write("Could not connect to WHOIS server!");
}
|
 |
 |
 |
 |
Date :
2011-02-10 06:27:28 |
By :
- |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
Code (VB.NET)
<% @Page Language="VB" %>
<% @Import Namespace="System.Net.Sockets" %>
<% @Import Namespace="System.Text" %>
<% @Import Namespace="System.IO" %>
<%
Dim tcpc As New TcpClient()
Try
tcpc.Connect("whois.networksolutions.com", 43)
Catch ex As SocketException
Response.Write(ex.ToString())
Response.[End]()
End Try
Dim strDomain As [String] = "domains.com" & vbCr & vbLf
Dim arrDomain As [Byte]() = Encoding.ASCII.GetBytes(strDomain.ToCharArray())
Dim s As Stream = tcpc.GetStream()
s.Write(arrDomain, 0, strDomain.Length)
Dim sr As New StreamReader(tcpc.GetStream(), Encoding.ASCII)
Dim strLine As String = Nothing
While (InlineAssignHelper(strLine, sr.ReadLine())) IsNot Nothing
Response.Write(strLine & "<br>")
End While
tcpc.Close()
%>
|
 |
 |
 |
 |
Date :
2011-02-10 06:29:48 |
By :
- |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|