Hi
i used all the following codes to access the IP Address of the client. it is showing the server details only. Please help me in this. I am working with VS2005 ASP.Net. I want to capture the client who is entering wrong data. This was handled in the code, but not able to get user's System Name.
/************************************************** *************************************/
Dim host As System.Net.IPHostEntry
Dim COMP_NAME() As String
host = System.Net.Dns.GetHostByName(Dns.GetHostName)
Response.Write("Remote host ip = " & host.AddressList(0).ToString)
Response.Write("Remote host name = " & Dns.GetHostName.ToString)
Response.Write("server variable Remotehost = " & Request.ServerVariables.Item("REMOTE_HOST"))
Response.Write("server variable localhost = " & Request.ServerVariables("LOCAL_ADDR")) 'host.HostName '
Response.Write("server variable httphost = " & Request.ServerVariables("HTTP_HOST"))
'COMP_NAME(0).ToString.ToUpper '
Response.Write("server variable windowsidentity= " & System.Security.Principal.WindowsIdentity.GetCurre nt().Name)
Response.Write("server variable machine name= " & Environment.MachineName)
Dim sIPAddress As String
sIPAddress = Request.ServerVariables("HTTP_X_FORWARDED_FOR")
If sIPAddress = "" Then sIPAddress = Request.ServerVariables("REMOTE_ADDR")
Response.Write("sIPAddress = " + sIPAddress + " <br>")
Dim hostaddresses() As IPAddress
Dim strName As String
hostaddresses = Dns.GetHostByName(Dns.GetHostName).AddressList
strName = Dns.GetHostByName(Dns.GetHostName).HostName
Dim i As Integer
For i = 0 To hostaddresses.GetLength(0) - 1
Response.Write(hostaddresses(i).ToString & "<br>")
Next
Response.Write(strName)
/************************************************** ****************************************/