Click here to Skip to main content
15,916,378 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
Hi
is there any way to <b>uniquely identify a computer</b> like MAC Address, or IP. I am using <b>C#, asp.net 3.5</b>. Actually i have a web system where i need to authenticate a user through login credentials and for a particular machine. user can login from registed machine only he cannot login from all the machines.

IP address is not a solution because it may change every time in case of dynamic IP's

please help
Posted

1 solution

Dear Friend,

string[] computer_name = System.Net.Dns.GetHostEntry(Request.ServerVariables["remote_addr"]).HostName.Split(new Char[] { '.' });
            String ecn = System.Environment.MachineName;
            txtECN.Text = computer_name[0].ToString();


This link will do the thing for you:-

http://forums.asp.net/t/821809.aspx/1[^]

Don't forget to mark this as your answer if it helps you out.

Thanks
 
Share this answer
 
Comments
Bernhard Hiller 17-Feb-12 3:37am    
It looks like problems could arise when the cmputer sits behind a proxy server or a NAT router - you'd get the "public" address/name, but behind might be several different computers.
Varun Sareen 17-Feb-12 11:23am    
you may be right..as i have never tried this :)
S.Aijaz 17-Feb-12 12:10pm    
yes the problems arise when router just discards mac adcress and other identity headers of the machine that originates a request and sends ip address of the router to the server. behind the router there may b a full city. for server all the requests are coming from same IP. for certain devices like data cards ip address changes every time you connect it to network. i surfed a lot but could not find a way to uniquely identify a client machine.

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