Come faccio a conoscere l'indirizzo IP del visitaore e il nome con cui è entrato?
Come faccio a conoscere l'indirizzo IP del visitaore e il nome con cui è entrato?
<%
string varIp;
//inserisce nella variabile varIp l'indirizzo IP del visitatore
varIp = Request.ServerVariables["REMOTE_ADDR"];
//visualizza l'ip
Response.Write ("Il tuo indirizzo IP è: " + varIp);
%>
Introduction
Use this code to resolve an IP address (e.g. 192.168.0.1) to a HostName (e.g. myComp.ISPServer1.com).
Code
IPHostEntry dnsHost = new IPHostEntry();
dnsHost = Dns.GetHostByAddress(Request.ServerVariables["REMOTE_ADDR"]);
// you can get the hostname using: dnsHost.HostName
Remarks
Note that in the Dns.GetHostByAddress parameter, you can use any IP address, i.e. it doesn't have to be got via Request.ServerVariables. It can be passed in to a function as a string or whatever.
questo se vuoi avere altre informazioni:
codice:<% HttpBrowserCapabilities browserObj; browserObj = Request.Browser; %> Client Name: <%=Request.ServerVariables["REMOTE_HOST"]%> Client IP Address: <%=Request.ServerVariables["REMOTE_ADDR"]%> Platform: <%=browserObj.Platform%> Browser String: <%=Request.ServerVariables["http_user_agent"]%> Browser Language:<%=Request.ServerVariables["http_accept_language"]%> Browser type: <%=browserObj.Type %> Browser version: <%=browserObj.Version%> Browser Beta: <%=browserObj.Beta%> Client CLR Version: <%=browserObj.ClrVersion%> Supports ActiveX controls: <%=browserObj.ActiveXControls %> Supports Cookies: <%=browserObj.Cookies%> Supports Frames: <%=browserObj.Frames%> Supports HTML Tables: <%=browserObj.Tables%> Supports Java Applets: <%=browserObj.JavaApplets%> Supports Java Scripts: <%=browserObj.JavaScript%> Supports MS DOM Version: <%=browserObj.MSDomVersion%>
ti ringrazio per la aver risposto tempestivamente!!
ciao, e ancora grazie![]()