I am not really sure how to Determining End user Machine MAC address and IP addresses (Local and ISP). We are using ASP.net based system using C# as programming language.
Can someone please guide. Regards, Yagya
I am not really sure how to Determining End user Machine MAC address and IP addresses (Local and ISP). We are using ASP.net based system using C# as programming language.
Can someone please guide. Regards, Yagya
If you are writing an Internet web app (as opposed to an intranet/LAN app), there is no way to determine the local address and MAC address of the client unless the client explicitly sends it to you. You can get the external (public, internet) address by Request.UserHostAddress
field. If the client is using a proxy, it would be another option to look at Request.ServerVariables["REMOTE_ADDR"]
and Request.ServerVariables["HTTP_X_FORWARDED_FOR"]
as they may reveal the true address. Either way, none of these options are guaranteed and you should not rely on them. They may be an additional layer of verification, but they should never be the primary mechanism for checking an identity.
The only thing that runs on the users machine when you use ASP.NET is HTML and JavaScript. You can not use JavaScript to get the MAC address, however, you can get the IP address and post it back.
To get the local IP address and the MAC address, you need to get the user to run an application e.g. a Java application.
to get the MAC address you need to have a signed ActiveX/ jar / .net dll. else you can get the IP address only.
Why signed, because most of the client have their browser settting to block any unsigned active component.
You can get a code signing certificate from a valid CA.