Click here to Skip to main content
15,892,298 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear all,

i want to store clent computer name or any other key in database..
how to get.

below code work in local computer fine but on server it get server details.

Response.Write("Owner: " & Request.LogonUserIdentity.Owner.ToString() & "<BR>")

Response.Write("Your Computer Name: " + System.Net.Dns.GetHostEntry(Request.UserHostAddress).HostName + "<BR>")
Posted
Comments
bbirajdar 25-Jan-13 6:25am    
Not possible.. Getting client's computer name is sheer violation of privacy policy... Its like asking for your email password.. Will you give it if someone asks you?
DINESH K MAURYA 25-Jan-13 6:34am    
can be get any information to client which is uniqe.
i want to give permission to specific computer to login the application.

You can use following piece of code and see if it helps

C#
string[] hostEntries = System.Net.Dns.GetHostEntry(Request.ServerVariables["remote_addr"]).HostName.Split(new Char[] { '.' });

txtECN.Text = hostEntries [0].ToString();


However, not sure how it will behave in case the user is "behind" firewall/proxy.

Hope that helps
Milind
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900