Scusate la mia ignoranza, ho utilizzato il seguente codice per ottenere info da un dominio (classico whois), il quanto funziona perfettamente ed eccellentemente:
<%@ Page Language="VB" ContentType="text/html" ResponseEncoding="utf-8" %>
<%@ Import Namespace = "System.Net.Sockets"%>
<%@ Import Namespace = "System.Text" %>
<%@ Import Namespace = "System.IO" %>
<script language="VB" runat="server">
dim urlStr as string
Public Sub Page_Load(Src As Object, E As EventArgs)
Try
dim ispDom, DomStr as string
DomStr = request.QueryString("NomDom") & request.QueryString("ExeDom")
if request("ExeDom") = ".it" then
ispDom = "whois.nic.it"
else if request("ExeDom") = ".com" then
ispDom = "whois.crsnic.net"
else if request("ExeDom") = ".net" then
ispDom = "whois.crsnic.net"
else if request("ExeDom") = ".org" then
ispDom = "whois.pir.org"
else if request("ExeDom") = ".eu" then
ispDom = "whois.nic.it"
urlStr = "Momentaneamente le informazioni Whois per tale estensione sono disponibili solo sul sito internet del registro. <a href='http://www2.whois.eu/whois/GetDomainStatus.htm?domainName=" & request.QueryString("NomDom") & "' target='_blank' > Cliccare sul seguente tasto per aprire il sito internet del registro.<a>"
else if request("ExeDom") = ".tv" then
ispDom = "whois.nic.tv"
else if request("ExeDom") = ".biz" then
ispDom = "whois.neulevel.biz"
else if request("ExeDom") = ".mobi" then
ispDom = "whois.dotmobiregistry.net"
else
ispDom = "whois.nic.it"
end if
' Connesione all' Host
Dim objTCPC As New TcpClient(ispDom, 43)
Dim strDomain As String = DomStr + "" & Chr(13) & "" & Chr(10) & "" 'txtDomain.Text + ddlExt.SelectedItem.Text + "" & Chr(13) & "" & Chr(10) & ""
Dim arrDomain As Byte() = Encoding.ASCII.GetBytes(strDomain)
' Inviare la richiesta e attendere la risposta
Dim objStream As Stream = objTCPC.GetStream()
objStream.Write(arrDomain, 0, strDomain.Length)
Dim objSR As New StreamReader(objTCPC.GetStream(), Encoding.ASCII)
lblInfo.Text = "Informazioni relative al dominio: " + strDomain + "
" + Regex.Replace(objSR.ReadToEnd(), "" & Chr(10) & "", "
")
objTCPC.Close()
Catch ex As Exception
lblInfo.Text = ex.ToString()
End Try
DataBind()
End Sub
</script>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>.:: Digital Design - Home Pannello d'Ordine ::.</title>
<link href="/style.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
body {
margin-left: 10px;
margin-top: 10px;
margin-right: 10px;
margin-bottom: 10px;
}
-->
</style></head>
<body>
<asp:Label id="lblInfo" text="" runat="server" onClick="Info" />
<%# urlStr %>
</body>
</html>
Nessuno sa dirmi se è possibile altresì ottenere solo 2 valori booleani, true o false, se esiste o no il dominio? Solo questi 2 valori nient'altro. Qualcuno mi illumini e mi dica se devo cambiare metedo, sono già stata tanto sotto pressione.