Server Error in '/' Application

spikec

New Member
Hi<BR>I'm using the following code:<BR><BR><%@ Import Namespace="System.Net" %><BR><BR><Script runat="Server"><BR><BR>Sub Page_Load<BR> If Not Page.IsPostBack then<BR> Dim sIPAddress As Integer<BR> sIPAddress = Request.ServerVariables("HTTP_X_FORWARDED_FOR")<BR> If sIPAddress="" Then sIPAddress = Request.ServerVariables("REMOTE_ADDR")<BR> txtIp.text = sIPAddress.ToString<BR> End If<BR>End Sub<BR><BR>Sub Button_Click( s As Object, e As EventArgs )<BR> Dim objIPHostEntry As IPHostEntry<BR><BR> objIPHostEntry = Dns.GetHostByAddress( txtIP.Text )<BR> lblHostName.Text = objIPHostEntry.HostName <BR>End Sub<BR><BR></Script><BR><BR><html><BR><head><title>Dns.aspx</title></head><BR><BR><form runat="Server"><BR><BR><h2>Enter an IP Address:</h2><BR><BR><asp:TextBox<BR> id="txtIP"<BR> Runat="Server" /><BR><BR><asp:Button<BR> Text="Submit!"<BR> OnClick="Button_Click"<BR> Runat="Server" /><BR><BR><p><BR><asp:Label<BR> id="lblHostName"<BR> EnableViewState="False"<BR> Runat="Server" /><BR><BR></form><BR></body><BR></html><BR><BR><BR>And get this error:<BR>Server Error in '/' Application.<BR>--------------------------------------------------------------------------------<BR><BR>The requested name is valid and was found in the database, but it does not have the correct associated data being resolved for <BR>Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. <BR><BR>Exception Details: System.Net.Sockets.SocketException: The requested name is valid and was found in the database, but it does not have the correct associated data being resolved for<BR><BR>Source Error: <BR><BR><BR>Line 15: Dim objIPHostEntry As IPHostEntry<BR>Line 16: <BR>Line 17: objIPHostEntry = Dns.GetHostByAddress( txtIP.Text )<BR>Line 18: lblHostName.Text = objIPHostEntry.HostName <BR>Line 19: End Sub<BR> <BR><BR>Source File: \genfs3www27igstumpertdns.aspx Line: 17 <BR><BR>Stack Trace: <BR><BR><BR>[SocketException (0x2afc): The requested name is valid and was found in the database, but it does not have the correct associated data being resolved for]<BR> System.Net.Dns.GetHostByAddress(IPAddress address) +186<BR> System.Net.Dns.GetHostByAddress(String address) +54<BR> ASP.dns_aspx.Button_Click(Object s, EventArgs e) in \genfs3www27igstumpertdns.aspx:17<BR> System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108<BR> System.Web.UI.WebControls.Button.System.Web.UI.IPo stBackEventHandler.RaisePostBackEvent(String eventArgument) +58<BR> System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler sourceControl, String eventArgument) +18<BR> System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData) +33<BR> System.Web.UI.Page.ProcessRequestMain() +1263<BR><BR> <BR><BR><BR>--------------------------------------------------------------------------------<BR>Version Information: Microsoft .NET Framework Version:1.0.3705.209; ASP.NET Version:1.0.3705.0 <BR><BR><BR>Can anyone please help me?
 
Back
Top