日期:2014-05-16 浏览次数:20508 次
<head> <meta name="viewport" content="width=device-width, initial-scale=1" http-equiv="Content-Type" charset="utf-8" /> <title>系统调查</title> <link rel="stylesheet" href="css/jquery.mobile-1.1.1.min.css" /> <link rel="stylesheet" href="css/custom.css" /> <script type="text/javascript" src="js/jquery-1.7.1.min.js"></script> <script type="text/javascript" src="js/function.js"></script> <script type="text/javascript" src="js/custom.js"></script> <script type="text/javascript"> </script> <script type="text/javascript" src="js/jquery.mobile-1.1.1.min.js"></script> </head> <body> <form action="form.php" method="post"> <!--还有一些是硬件信息的不是循环输出,所以不列出--> <ul id="softlist" data-role="listview" data-inset="true" data-theme="c" data-divider-theme="b"> <li data-role="list-divider">软件信息</li> </ul> </form>
function GetSoft(){ var locator = new ActiveXObject ("WbemScripting.SWbemLocator"); var service = locator.ConnectServer("."); var properties = service.ExecQuery("Select * from Win32_Product"); var e = new Enumerator (properties); var softlist=""; var i = 0; for (;!e.atEnd();e.moveNext ()){ var p = e.item(); softlist = softlist + "<li><input type ='text' id='soft" + i + "' name='soft" + i + "' value='" + p.Name +"'></li>"; i = i + 1; } softlist = softlist + "<li><h3>软件计数:</h3><input type ='text' id='softcunt' value='" + i +"'></li>"; return softlist; }
$("#softlist").append(GetSoft());