how to get mac address of client that browse web site by asp.net mvc c#
it's unfortunately not possible to reliably get the mac address of the client machine due to firewalls, proxies and ISP generic addresses being given. However, you can make a stab at getting the ip address by using:
var remoteIpAddress = Request.UserHostAddress;
However, this may or may not actually represent the client machine and is more likely the ISP gateway or some other ip address. It's a well known problem and one that even google have found hard to crack using clientside javascript (the idea here being that you get the actual local ip address via a js library and pass that over to your server function).
[edit] - might be worth taking a look at the following for inspiration/confirmation of the issue:
http://www.dotnetfunda.com/forums/thread2088-how-to-get-mac-address-of-client-machine.aspx
how to get the Mac Address of client machine in c# MVC
There's no way to uniquely identity a client machine. The best you can do is add a cookie to the client with some sort of unique identifier. This is what Google and other ad and marketing companies do to try to track a user. However, any cookie set in a browser will not be available to an Android app to consume, so you'll still have no way to link the two. The only foolproof approach to uniquely identifying a user across multiple platforms is with an account. By the user signing at your website, then signing in on your Android app, you'll know it was the same user. Otherwise, you're out of luck.
Related Topics
How to Change Another Program's Window's Size
Starting a Process with Credentials from a Windows Service
How to Check If a File Exists in a Folder
The Name <...> Does Not Exist in the Namespace Clr-Namespace <...>
Should We Always Include a Default Constructor in the Class
Why Is Linq .Where(Predicate).First() Faster Than .First(Predicate)
Declaration of Anonymous Types List
Winforms Issue - Error Creating Window Handle
Generate C# Project Using Cmake
How to Set a Conditional Compile Variable
Rotate a Point by Another Point in 2D
Bring Another Processes Window to Foreground When It Has Showintaskbar = False
Enumerating Through an Object's Properties (String) in C#
Right Way to Dispose Image/Bitmap and Picturebox