Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Find MAC address.

Reply
Thread Tools

Find MAC address.

 
 
Arun
Guest
Posts: n/a
 
      11-03-2003
Like its possible to find IP address of a visitor in same way is it possible to find the visitor's PC's MAC address?

-Regards,

 
Reply With Quote
 
 
 
 
John Timney \(Microsoft MVP\)
Guest
Posts: n/a
 
      11-03-2003
look in the servervariables collection

--
Regards

John Timney (Microsoft ASP.NET MVP)
----------------------------------------------
<shameless_author_plug>
Professional .NET for Java Developers with C#
ISBN:1-861007-91-4
Professional Windows Forms
ISBN: 1861005547
Professional JSP 2nd Edition
ISBN: 1861004958
Professional JSP
ISBN: 1861003625
Beginning JSP Web Development
ISBN: 1861002092
</shameless_author_plug>
----------------------------------------------

"Arun" <ss> wrote in message news:(E-Mail Removed)...
Like its possible to find IP address of a visitor in same way is it possible
to find the visitor's PC's MAC address?

-Regards,



 
Reply With Quote
 
 
 
 
Natty Gur
Guest
Posts: n/a
 
      11-03-2003
Hi,

use WMI :

private static string GetMacAddress()
{
ManagementClass mc = new ManagementClass("Win32_NetworkAdapter");
foreach (ManagementObject mo in mc.GetInstances())
{
string macAddr = mo["MACAddress"] as string;
if ( macAddr != null && macAddr.Trim() != "" )
return macAddr;
}
return "";
}


Natty Gur[MVP]
Phone Numbers:
Office: +972-(0)9-7740261
Fax: +972-(0)9-7740261
Mobile: +972-(0)58-888377


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
Reply With Quote
 
John Timney \(Microsoft MVP\)
Guest
Posts: n/a
 
      11-03-2003
sorry - misread your post. Thought you were looking for the IP address.

--
Regards

John Timney (Microsoft ASP.NET MVP)
----------------------------------------------
<shameless_author_plug>
Professional .NET for Java Developers with C#
ISBN:1-861007-91-4
Professional Windows Forms
ISBN: 1861005547
Professional JSP 2nd Edition
ISBN: 1861004958
Professional JSP
ISBN: 1861003625
Beginning JSP Web Development
ISBN: 1861002092
</shameless_author_plug>
----------------------------------------------

"John Timney (Microsoft MVP)" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> look in the servervariables collection
>
> --
> Regards
>
> John Timney (Microsoft ASP.NET MVP)
> ----------------------------------------------
> <shameless_author_plug>
> Professional .NET for Java Developers with C#
> ISBN:1-861007-91-4
> Professional Windows Forms
> ISBN: 1861005547
> Professional JSP 2nd Edition
> ISBN: 1861004958
> Professional JSP
> ISBN: 1861003625
> Beginning JSP Web Development
> ISBN: 1861002092
> </shameless_author_plug>
> ----------------------------------------------
>
> "Arun" <ss> wrote in message news:(E-Mail Removed)...
> Like its possible to find IP address of a visitor in same way is it

possible
> to find the visitor's PC's MAC address?
>
> -Regards,
>
>
>



 
Reply With Quote
 
John Saunders
Guest
Posts: n/a
 
      11-04-2003
"Arun" <ss> wrote in message news:(E-Mail Removed)...
Like its possible to find IP address of a visitor in same way is it possible
to find the visitor's PC's MAC address?

Yes. Exactly the same way. It usually won't work, just as getting the
visitor's IP address usually won't work.

If the visitor is coming to you from behind a proxy server or NAT box or
something else like that, then you will not know the user's IP address, only
that of the NAT box or proxy server.

Similarly, you can _never_ get the MAC address of a visitor unless the
visitor is directly on the same LAN as your server. If the visitor gets to
your server through a router, then you cannot get the MAC address.

In any case, IP addresses are for routing packets, MAC addresses are for
sending packets between NICs on the same LAN, so unless you're a router or a
NIC, you shouldn't be messing with IP addresses or MAC addresses. Using
these things for anything other than for what they were intended is likely
to get you into trouble in the long run.
--
John


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to exclude action of Find::Find::find in subdirectories withknown names? vdvorkin Perl Misc 3 02-14-2011 05:28 AM
How to exclude action of Find::Find::find in subdirectories withknown names? vdvorkin Perl Misc 0 02-10-2011 05:18 PM
Vertical Gap between DIVs in Opera 8.5 Mac + IE 5.2 Mac mangm HTML 2 12-01-2005 12:48 PM
Find.find does not find orphaned links? Wybo Dekker Ruby 1 11-15-2005 02:50 PM
Senseless rendering: Mac.Mozilla != Mac.Netscape6.01 ?!?! Roman =?ISO-8859-15?Q?Bl=F6th?= HTML 1 07-02-2003 10:23 AM



Advertisments