From csdn
// I looked at other materials for extraction of CPU, but the Mac's ready-made code did not have the hard disk serial number. After searching for a long time, I found the parameter for extracting the hard disk serial number. So I made it up. <SCRIPT> function disk () {// var locator = new activexobject ("wbemscripting. swbemlocator "); var service = locator. connectserver (". "); var properties = service. execquery ("select * From win32_diskdrive"); var E = new enumerator (properties); document. write ("<Table border = 1>"); document. write ("<caption> hard disk serial number </caption>"); (;! E. atend (); E. movenext () {var P = E. item (); document. write ("<tr>"); document. write ("<TD style = 'color: Blue'>" + P. signature + "</TD>"); document. write ("</tr>");} document. write ("</table>");} disk (); </SCRIPT>
// Code found here: // for ASP or. net users, through ASP or. net Language to obtain client hardware information is very familiar. // but how can I obtain client information through a client script such as JavaScript? See the following example:
<SCRIPT> function button1_onclick () {// CPU information var locator = new activexobject ("wbemscripting. swbemlocator "); var service = locator. connectserver (". "); var properties = service. execquery ("select * From win32_processor"); var E = new enumerator (properties); document. write ("<Table border = 1>"); document. write ("<caption> CPU Information </caption>"); (;! E. atend (); E. movenext () {var P = E. item (); document. write ("<tr>"); document. write ("<TD>" + P. caption + "</TD>"); document. write ("<TD>" + P. deviceID + "</TD>"); document. write ("<TD>" + P. name + "</TD>"); document. write ("<TD>" + P. cpustatus + "</TD>"); document. write ("<TD>" + P. availability + "</TD>"); document. write ("<TD>" + P. LEVEL + "</TD>"); document. write ("<TD style = 'color: Blue'>" + P. process OrId + "</TD>"); document. write ("<TD>" + P. systemname + "</TD>"); document. write ("<TD>" + P. processortype + "</TD>"); document. write ("</tr>");} document. write ("</table>");} function button2_onclick () {// floppy disk information var locator = new activexobject ("wbemscripting. swbemlocator "); var service = locator. connectserver (". "); var properties = service. execquery ("select * From win32_floppydrive"); var E = new E Numerator (properties); document. Write ("<Table border = 1>"); document. Write ("<caption> floppy disk Information </caption>"); (;! E. atend (); E. movenext () {var P = E. item (); document. write ("<tr>"); document. write ("<TD>" + P. description + "</TD>"); document. write ("<TD>" + P. deviceID + "</TD>"); document. write ("<TD>" + P. status + "</TD>"); document. write ("<TD>" + P. manufacuturer + "</TD>"); document. write ("</tr>");} document. write ("</table>");} function button3_onclick () {// CD-ROM information var locator = new activexobject ("wbemsc Ripting. swbemlocator "); var service = locator. connectserver (". "); var properties = service. execquery ("select * From win32_cdromdrive"); var E = new enumerator (properties); document. write ("<Table border = 1>"); document. write ("<caption> CD-ROM Information </caption>"); (;! E. atend (); E. movenext () {var P = E. item (); document. write ("<tr>"); document. write ("<TD>" + P. caption + "</TD>"); document. write ("<TD>" + P. description + "</TD>"); document. write ("<TD>" + P. drive + "</TD>"); document. write ("<TD>" + P. status + "</TD>"); document. write ("<TD>" + P. medialoaded + "</TD>"); document. write ("</tr>");} document. write ("</table>");} function button4_onclick () {// keyboard information VaR Locator = new activexobject ("wbemscripting. swbemlocator "); var service = locator. connectserver (". "); var properties = service. execquery ("select * From win32_keyboard"); var E = new enumerator (properties); document. write ("<Table border = 1>"); document. write ("<caption> keyboard Information </caption>"); (;! E. atend (); E. movenext () {var P = E. item (); document. write ("<tr>"); document. write ("<TD>" + P. description + "</TD>"); document. write ("<TD>" + P. name + "</TD>"); document. write ("<TD>" + P. status + "</TD>"); document. write ("</tr>");} document. write ("</table>");} function button5_onclick () {// motherboard information var locator = new activexobject ("wbemscripting. swbemlocator "); var service = locator. connectserver (". "); Var properties = service. execquery ("select * From win32_baseboard"); var E = new enumerator (properties); document. write ("<Table border = 1>"); document. write ("<caption> motherboard Information </caption>"); (;! E. atend (); E. movenext () {var P = E. item (); document. write ("<tr>"); document. write ("<TD>" + P. hostingboard + "</TD>"); document. write ("<TD>" + P. manufacturer + "</TD>"); document. write ("<TD>" + P. poweredon + "</TD>"); document. write ("<TD>" + P. product + "</TD>"); document. write ("<TD style = 'color: Blue'>" + P. serialnumber + "</TD>"); document. write ("<TD>" + P. version + "</TD>"); document. write ("</tr>");} document. write ("</table>") ;}button%onclick (); button2_onclick (); button3_onclick (); button4_onclick (); button5_onclick (); </SCRIPT>