Resolve an host
<%@ Page Language="vb" %>
<%@ Import Namespace="System.Net" %>
<HTML>
<script language="vb" runat="server">
Private Sub btnRisolvi_Click(ByVal sender As Object, ByVal e As EventArgs)
Try
Dim ipAddress As IPAddress = Dns.Resolve("" & tbHost.Text & "").AddressList(0)
lbIP.Text = "Indirizzo IP: " + ipAddress.ToString()
Catch
lbIP.Text = "Host sconosciuto!"
End Try
End Sub
</script>
<body>
<form name="Form1" runat="server" ID="Form1">
<TABLE id="Table1" cellSpacing="0" cellPadding="4" width="275" border="0" height="55" bgColor="aliceblue">
<TR>
<TD width="50">Host</TD>
<TD>
<asp:TextBox id="tbHost" runat="server" Width="233px"></asp:TextBox></TD>
</TR>
<TR>
<TD width="50"></TD>
<TD>
<asp:Button id="btnRisolvi" runat="server" Text="Risolvi" OnClick="btnRisolvi_Click"></asp:Button></TD>
</TR>
</TABLE>
<BR>
<asp:Label id="lbIP" runat="server"></asp:Label>
</form>
</body>
</HTML>
Download Code...
Print Page