|
Hi
can any one help me out in finiding
how to get the mac number of the client system when my application is running in a common server in asp.net
Thanks in advance
Regards,
Gayathri Devi S
|
|
|
|
|
You'll have to seacrh the arp cache. You can find the arp cache in the System.Management; do a query for WIN32_NetworkAdapterConfiguration, and then filter by IP address.
You'll require a full trust environment for this. Note that is NOT the client mac address, but the MAC address of the next hop, if you're connected to a router, or of the bridge if you're connected to a bridge. This will only work in lan environments where clients are connected to switches or hubs.
example here[^]
|
|
|
|
|
Thanks for ur answer
But i need it to view my client mac address
is there anyway to find it using asp.net
|
|
|
|
|
No. It's just not available. The only way to get it is to persuade the client to give it to you.
|
|
|
|
|
No. Information like this is outside the browser security sandbox, and may not be available in the same way because the user could be using a Mac or Linux box. When you think about it, would you really want javascript code (that's what it would have to be), to be able to gain access to client data? This would represent a security hole.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Pete O'Hanlon wrote: a Mac or Linux box
Or a dumb terminal?
|
|
|
|
|
ASP.NET code runs on the server side, not the client.
There is no way for you to get the clients MAC address from the server.
Even running client-side JavaScript or some other component will not allow you to get that information without the client granting your component full trust, and that's rare to find.
BTW: The MAC address is NOT a globally unique identifier.
|
|
|
|
|
Dave Kreskowiak wrote: The MAC address is NOT a globally unique identifier
But... but... the presenter at the launch event I went to last week said it is.
|
|
|
|
|
Why do they allow crask-smoking idiots to pollute the masses with bad information?
Each vendor ID part of the MAC address is limited to 16.7 million different addresses. The chances of a duplicate are actually pretty good. And I can speak from experience that it is possible to have to NIC's on the same subnet with the same MAC address. Real fun to troubleshoot that problem - great times!
|
|
|
|
|
I dunno; I once had to correct someone who thought that no two computers could have the same IP address.
|
|
|
|
|
You can have multiple NICs with the same MAC on the same network, just not on the same segment hanging from a hub. Since most hubs have been replaced with switches, this really isn't a problem anymore. Each port on the switch is treated like it's on it's own segment. Only the machine connected to the port hears the signal. In the old hub environment, every machine connected to the hub heard the same signal making MAC's more important.
|
|
|
|
|
well, it is, unless it isn't.
it should be unique; each hardware manufacturer should acquire a range of MAC numbers, then take care to manufacture all different numbers within his range.
when two devices with identical MAC number sit in a single network, trouble is guaranteed.
FYI: you can spoof the MAC number easily on Windows systems; a tiny code snippet can replace the running MAC address by anything you like.
|
|
|
|
|
thanks for all ur replys
but the logic of my project is this
my project is a web based one
i should allow the user to the login from only one system not from multiple system (respective user id for respective system)
if he need to use in other system , he should register for a new userid
so what kind of information should i have to track so as to get this logic run
|
|
|
|
|
Can't be done. Even Microsoft can't identify a machine uniquely when the only thing they have is a http connection (I'm sure they'd love too). You could persuade the user to run some ActiveX control which would gather information on the system, and pass it back to you, but this will seriously limit your audience. (windows + IE, or FireFox maybe, no other browsers, no linux, no MAC, no Iphone, no nothing...). ActiveX used to be the single most widespread technology for easily installing viruses on client machines, so it has been banned from normal use, and now rots in IT Hell, where it belongs. ( Actually some vendors are still using it, but they shoudln't )
You could probably achieve the same thing with a Java applet which runs out of the sandbox, but that's the same evil. (and would require your clients to install Java, and allow it full access to their system. (Fat chance)
|
|
|
|
|
Sounds like you' re doing this in corporate environment?
The supported ways to do this are:
- getting the information from the user's profile. Every user has a profile, which is divided in a roaming part and a local part. The roaming part is stored on a server, and travels with the user when he moves from machine to machine. The local part is only stored on the machine to which he is logged on. You could store your checking information in the local profile part. This of course cannot be done using ASP.NET. You'll need some client (windows) components to talk to.
Note that if you're in a corporate environment, checking the dns name of the machine is just as efficient
- Use Silverlight 4 and local storage. You could store the userid in local storage on the user's machine. This will again require permission from the user.
- I think you can do the same with Flash, but you'll have to ask the Flash experts that.
NOTE that these are not fail-safe solutions. A determined user can still fiddle around with the data, and persuade you that he's on an another machine.
|
|
|
|
|
One way to do this (it's not foolproof as I'll explain in a moment) is to get the client IP. To do this, you can use Request.UserHostAddress() to retrieve the IP.
It's not perfect because the user may be logging into the same application from a separate instance of the browser on the same machine.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Hi, i am working on c# .net windows environment. While developing the application i realized that the application .exe that installs in Destination machine i.e C:\Program Files\Application Folder .. is easily DE-COMPILED By application like .Net Reflector.
My question that is it possible to the Application .exe so that it can't decompiled by reflector (or other software).Is the procedure to make it possible is simple or requires some Special Practices.
Thanks
|
|
|
|
|
The short answer to this very common question is no. You can't prevent a .net application or assembly from being decompiled. The best you can do is use an obfuscator to cloud the issue a bit.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
In one of my projects I have used the following technique:
some function bodies were encrypted, and the IL in it was decrypted on-the-fly, just before you enter into this function.
You can implement something like it too, it's not too hard.
Die Energie der Welt ist konstant. Die Entropie der Welt strebt einem Maximum zu.
|
|
|
|
|
Why don't you submit an article on this technique. I'm sure others would find it interesting.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
You can also try using a type name longer than 4096 characters, it messes with some reversing tools..
|
|
|
|
|
Are you a developer I would fall out with? Types with names longer than 4096 characters. It wouldn't just be decompilers it would mess with.
|
|
|
|
|
It wouldn't have to be in the source, just in the assembly
And the C# compiler sets a maximum length of 512 characters anyway..
|
|
|
|
|
Trying is generally not worth the trouble.
|
|
|
|
|
You can go for "WinLicense" software to protect and manage license of your .NET code.
See details from following link.
http://www.oreans.com/winlicense.php[^]
Hope this will help!
Jinal Desai
|
|
|
|