Home  >  Article  >  Web Front-end  >  javascript hard disk serial number other hardware information_javascript skills

javascript hard disk serial number other hardware information_javascript skills

WBOY
WBOYOriginal
2016-05-16 18:57:181262browse

After looking at other information, there are ready-made codes for extracting CPU and MAC, but there is no hard drive serial number. It took me a long time to find the parameters for extracting the hard drive serial number. So I made up for it myself.


Extract hard drive serial number








The code found here:
For those who have written ASP or .net, obtain the client hardware through asp or .net language Information is very familiar. But how to obtain client information through client-side scripts such as javascript? Please see the following example:

 
  Javascript gets client hardware information-www.web2bar.cn/
  content="http://schemas.microsoft.com/intellisense/ie5">
 


name="Button1" language=javascript onclick="return Button1_onclick()">
  


Use javascript to get customers The main advantage of the information on the client is that it does not require server resources. There is no need to refresh the web page. Execute the script directly on the client to obtain the display.

I found the parameter of the hard disk serial number here:
'Get the hard disk serial number No.
Dim cmicWmi As New System.Management.ManagementObjectSearcher("SELECT * FROM Win32_DiskDrive")
Dim Uint32 As UInt32
For Each cmicWmiObj As ManagementObject In cmicWmi.Get
Uint32 = cmicWmiObj("signature" )
Next <script> <BR>function disk() {//硬盘序列号 信息 <BR>   var locator = new ActiveXObject ("WbemScripting.SWbemLocator"); <BR>   var service = locator.ConnectServer("."); <BR>   var properties = service.ExecQuery("SELECT * FROM Win32_DiskDrive"); <BR>   var e = new Enumerator (properties); <BR>   document.write("<table border=1>"); <BR>   for (;!e.atEnd();e.moveNext ()) <BR>   { <BR>      var p = e.item (); <BR>      document.write("<tr>"); <BR>      document.write("<td>" + p.signature + ""); <BR>      document.write(""); <BR>   } <BR>   document.write(""); <BR>} <BR></script>TextBox1.Text = Uint32.ToString and finally put it together, haha.
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn