看了看别的资料有提取CPU,MAC的现成代码却没有硬盘序列号,找了好久才找到提取硬盘序列号的参数。于是自己给补上了。
提取硬盘序列号 <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>
在这上找的代码:
对于写过ASP或.net 的人来说,通过asp或.net 语言来获得客户端的硬件信息是很熟悉的.但如何通过javascript这种客户端脚本来获得客户端的信息呢?请看以下实例:
javascript获得客户端硬件信息-www.web2bar.cn/ content="http://schemas.microsoft.com/intellisense/ie5">
name="Button1" language=javascript onclick="return Button1_onclick()">
使用javascript方式获得客户端的信息主要的优点是,不需求服务器资源.不需求刷新网页.直接在客户端执行脚本获得显示.
在这上找到了硬盘序列号的参数:
\'获得硬盘序列号
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
TextBox1.Text = Uint32.ToString
和在一块总算给提出来了,呵呵。