ASP.net get hardware information

六眼飞鱼酱① 提交于 2021-01-04 15:23:05

问题


If I create an ASP.net page, am I able to get the current users CPUID and BIOS serial number? Or is that not allowed because of security?

I currently have a Visual Basic.net application that gets these values, I am just wondering if I can do the same thing on a web page.


回答1:


In a nut shell, no you cannot get this information using just a regular html & JavaScript web page.

That's not however, to say that it's not possible.

If your client computer has Java, Flash or Silver-light installed then it's not within the realms of impossibility to make one of those plug-in architectures query the client pc in some way and gather this data. I do happen to know for sure that it's possible from a Java Applet because a lot of companies like Nvidia and AMD use it to get hardware info when giving you a choice of drivers to download.

While these guys might not be looking for the bios serial number and such like, they are by the very nature of what they are doing using the same approach and methods as would be needed to read the information you seek.

Personally I've also done it using silver-light, but in a controlled environment where I had a say in what ran on the client computers.

Now, going beyond the original question, most people ask questions of this nature, because they are looking for a way to uniquely identify a visitor to their web-site generally without needing to save a cookie or similar.

I've previously outlined a number of methods in posts on the .NET Nuts and bolts column at code guru that I write ( Link Here ) and one of the most common in current times is the finger printing technique.

Essentially the finger printing technique works by taking a combination of all the standard data that most modern day browsers now provide to the web server, and then using this data to form some kind of hash token or unique identifier.

What you need to ensure if your going to use this method however, is that you don't pick bits of data that are likely to change too frequently. Things like the user agent, screen resolution, operating system version, java version and similar are generally good choices. You can also get by using the IP address but I'd be careful with that as most consumers are on dynamic these days so it may change unexpectedly.

Things you should avoid if your going to fingerprint are things like current date & time, browser name presence of a specific header (Unless of course it's a header you provide), anything that's going to give you an answer that can be broadly matched to many other systems or that changes with great frequency is a bad choice.

You could also go as far as using JavaScript on the client side, to create a hash using local info on the client itself, then ship that hash to you using an ajax call, or in a hidden form or url parameter.

Update Jan 2021

  1. In reference to the link above, I no longer as of this date write for code Guru. All of my original articles are still online, but you will have to search for them.



回答2:


If you do it in on a web page you will get the server's BIOS serial number. Because the VB.NET function runs on the server.

You cannot access to this data from a simple HTML/JS/CSS Web page. Sorry, It's a security thing. You don't want anyone to know your hardware specifications when accessing some internet page.



来源:https://stackoverflow.com/questions/16128691/asp-net-get-hardware-information

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!