index.aspx
<html>
<head>
</head>
<body>
<span class="title" align="center">WHOIS ASP.NET page (www.novinweb.com) </span>
<form style="padding:0; margin:0;" action="whois.aspx" method="post" target="foo" onsubmit="window.open(,foo, width=570,height=600,status=no,resizable=no,scrollbars=yes)">
<table dir="rtl"><tr>
<td class="main" align="right"><font face="Tahoma" size="2">نام دامنه :</font></td>
<td class="main">
<input type="text" class="main" name="DomainName" dir="ltr" style="font-family: Tahoma; font-size: 8pt" size="15"></td>
</tr> <tr>
<td align="center" colspan="2" style="font-family: Tahoma; font-size: 8pt"><input type="Submit" id="btnSubmit" value="مشاهده" style="font-family: Tahoma; font-size: 8pt" /></td>
</tr>
</table>
</form>
</body>
</html>
whois.aspx
<% @Page Language="vb" Debug="false"%>
<% @Import Namespace="System.Net.Sockets" %>
<% @Import Namespace="System.Text" %>
<% @Import Namespace="System.IO" %>
<% @Import Namespace="System.Text.RegularExpressions" %>
<script language="vb" runat=server>
dim strserver
dim strpp
Sub Page_Load(S As Object, E As EventArgs)
if Request.Form("DomainName")="" then
response.redirect("http://www.novinweb.com")
end if
Try
Dim strDomaine As String = Request.Form("DomainName")
Dim chSplit As Char() = {"."C}
Dim arrDomaine As String() = strDomaine.Split(chSplit)
If arrDomaine.Length <> 2 Then
Return
End If
Dim nLength As Integer = arrDomaine(1).Length
Dim nLengthe As string = arrDomaine(1)
select case nLengthe
case "com"
strserver="whois.crsnic.net"
case "net"
strserver="whois.crsnic.net"
case "org"
strserver="whois.publicinterestregistry.net"
case "ir"
strserver="whois.nic.ir"
case "biz"
strserver="whois.biz"
case "info"
strserver="whois.afilias.info"
case "name"
strserver="whois.nic.name"
case "uk"
strserver="whois.nic.uk"
case "edu"
strserver="whois.educause.net"
end select
Dim objTCPC As New TcpClient(strserver, 43)
Dim strDomain As String = Request.Form("DomainName") + "" & Chr(13) & "" & Chr(10) & ""
Dim arrDomain As Byte() = Encoding.ASCII.GetBytes(strDomain)
Dim objStream As Stream = objTCPC.GetStream()
objStream.Write(arrDomain, 0, strDomain.Length)
Dim objSR As New StreamReader(objTCPC.GetStream(), Encoding.ASCII)
strpp= "<b>" + Request.Form("DomainName") + "</b><br><br>" + Regex.Replace(objSR.ReadToEnd(), "" & Chr(10) & "", "<br>")
objTCPC.Close()
Catch ex As Exception
strpp = ex.ToString()
End Try
End Sub
</script>
<html>
<head>
<title>Novinweb.com whois</title>
</head>
<body>
<p align="center">
<a href="http://www.novinweb.com" target="_blank"><img border="0" src="http://www.novinweb.com/picture/2008195-50-59PMbaner2.jpg" ></a>
</p>
<p><font face="verdana" color="#000000" size="2">
<%=strpp %></font></p>
</body>
</html>