Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET
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 25-Jan-13 0:22am
Comments
aspnet_regiis -i at 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 at 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.
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

You can use following piece of code and see if it helps
 
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
  Permalink  

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

  Print Answers RSS
0 OriginalGriff 675
1 CPallini 320
2 Sergey Alexandrovich Kryukov 305
3 BillWoodruff 285
4 Peter Leow 255


Advertise | Privacy | Mobile
Web04 | 2.8.141029.1 | Last Updated 25 Jan 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100