wood burning stoves 2.0*
The moose likes Servlets and the fly likes How to get Mac Id of my client machine Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Reply locked New topic
Author

How to get Mac Id of my client machine

ganesh pol
Ranch Hand

Joined: Apr 29, 2005
Posts: 151
i want to write one servlet which will give me MacID of my client from whom request came

2] also the IP Address Of client although it came through proxy server

help me it is urgent
Darren Edwards
Ranch Hand

Joined: Aug 17, 2005
Posts: 69
Java has no native way to get a MAC address - you will have to write some native code for each platform. Then again it will probably be useless to you as a mac address changes as the packet moves through different network segments.

Proxy servers don't tell you the client IP.
suresh senapathi
Greenhorn

Joined: Jan 14, 2009
Posts: 13
Subject : How to get Mac Id of my client machine

Hi,

I want java code to get client MAC Address.
Right now i am able to get Client IP perfectly.But i want MAC address for that IP.

can any one help me?

Thanks in advance.

Regards,
Suresh.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41180
    
  45
It's not possible in a servlet - the HTTP request simply doesn't contain that information.

For a desktop app, you'll need to find a native API that returns that information, and access it through JNI, just like Darren mentioned.


Ping & DNS - my free Android networking tools app
suresh senapathi
Greenhorn

Joined: Jan 14, 2009
Posts: 13
Ulf Dittmer wrote:It's not possible in a servlet - the HTTP request simply doesn't contain that information.

For a desktop app, you'll need to find a native API that returns that information, and access it through JNI, just like Darren mentioned.


Hi ,

Thanks for your reply.
I am not seeing the solution in servlet.
what ever the tec in java no problem.
can you please tell me how we use JNI to implement this.

Thanks in advance.

Regrds,
suresh
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60810
    
  65

Repeat: not possible.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
suresh senapathi
Greenhorn

Joined: Jan 14, 2009
Posts: 13
Bear Bibeault wrote:Repeat: not possible.


Hi,

any one know how to get client machine information from my system(Client mac address(network address)).

Thanks in advance.

Regards,
Suresh
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60810
    
  65

Bear Bibeault wrote:Repeat: not possible.


So what part of it's not possible is confusing you?

The only way to do this is to run an agent program on the client that can use JNI to get the information and communicate it to the server. There is no way to do this with servlets or HTTP.
suresh senapathi
Greenhorn

Joined: Jan 14, 2009
Posts: 13
Bear Bibeault wrote:
Bear Bibeault wrote:Repeat: not possible.


So what part of it's not possible is confusing you?

The only way to do this is to run an agent program on the client that can use JNI to get the information and communicate it to the server. There is no way to do this with servlets or HTTP.


Hi,
Thanks for the reply.
i have less knowledge about these type of things.

can any help me regarding jni.

i don't know who is the client ,who eve it may be ,i want to get network information.his information.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60810
    
  65

Since this is a servlets forum, it is not the right place to post JNI questions.

But, if you don't know who the client is, how are you going to get him to install your program on his system?
suresh senapathi
Greenhorn

Joined: Jan 14, 2009
Posts: 13
Bear Bibeault wrote:Since this is a servlets forum, it is not the right place to post JNI questions.

But, if you don't know who the client is, how are you going to get him to install your program on his system?


Hi,

Thanks for your response.
My actual requirement is,get the system information(MAC address), the person who access my product site in the network.
This is to avoid fraud customers.

Can any help me?

Thanks in advance.

Regards,
Suresh
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60810
    
  65

I'm going to close this topic as this is not a Servlets issue.

I suggest you post a question in another forum. You will not be able to do this without being able to install a program on the client computer.
 
Don't get me started about those stupid light bulbs.
 
subject: How to get Mac Id of my client machine
 
Similar Threads
youngest SCWCD???
Substring
Regex ???
Struts 2 session management using URL rewriting
Actual Answering phone messages