JavaScript »ñÈ¡¿Í»§¶Ë¼ÆËã»úÓ²¼þ¼°ÏµÍ³ÐÅÏ¢(תÔØ)
ͨ¹ýWMIÀ´ÊµÏÖ»ñÈ¡¿Í»§¶Ë¼ÆËã»úÓ²¼þ¼°ÏµÍ³ÐÅÏ¢:
1//ϵͳÐÅÏ¢»ñÈ¡
2function getSysInfo(){
3 var locator = new ActiveXObject ("WbemScripting.SWbemLocator");
4 var service = locator.ConnectServer(".");
5 //CPUÐÅÏ¢
6 var cpu = new Enumerator (service.ExecQuery("SELECT * from Win32_Processor")).item();
7 var cpuType=cpu.Name,hostName=cpu.SystemName;
8 //ÄÚ´æÐÅÏ¢
9 var memory = new Enumerator (service.ExecQuery("SELECT * from Win32_PhysicalMemory"));
10 for (var mem=[],i=0; !memory.atEnd(); memory.moveNext()) mem[i++]={cap:memory.item().Capacity/1024/1024,speed:memory.item().Speed}
11 //ϵͳÐÅÏ¢
12 var system=new Enumerator (service.ExecQuery("SELECT * from Win32_ComputerSystem")).item();
13 var physicMenCap=Math.ceil(system.TotalPhysicalMemory/1024/1024),curUser=system.UserName,cpuCount=system.NumberOfProcessors
14
15 return {cpuType:cpuType,cpuCount:cpuCount,hostName:hostName,curUser:curUser,memCap:physicMenCap,mem:mem}
16}
´úÂëʵÏÖÖ÷Òª°üÀ¨Õ⼸²¿·Ö£º
ÏÈͨ¹ýnew ActiveXObject ("WbemScripting.SWbemLocator"); ·ÃÎʵ½WbemScripting¶ÔÏó¡£
ͨ¹ýlocator.ConnectServer("."); Á¬½ÓÎÒÃDZ¾µØµçÄÔ£¨.´ú±í±¾µØµçÄÔ£¬µ±È»
Ò²¿ÉÒÔ·ÃÎÊÆäËû¼ÆËã»ú£©¡£
ͨ¹ýservice.ExecQuery("SELECT * from Win32_Processor")Õâ¸öÀàËÆsqlµÄÓï¾ä£¨ÆäʵϵͳÐÅÏ¢Ò²ÊÇ´æ´¢ÔÚ¼ÆËãÖÐÒ»¸öÀàËÆÊý¾Ý¿âµÄÎļþÖУ©»ñÈ¡ÎÒÃÇÐèÒªµÄ¶ÔÏóµÄ¼Ç¼¼¯¡£
ͨ¹ýnew EnumeratorÀ´´´½¨Ò»¸ö¿Éö¾ÙµÄ¶ÔÏó£¬ÏÂÃæ¾Í¿ÉÒÔ±éÀúÈ¡ÐÅÏ¢ÁË¡£
×¢Ò⣺ÔËÐеÄÇ°ÌáÊÇÒªÐÞ¸Ää¯ÀÀÆ÷°²È«ÉèÖ㬓ÔÊÐí¶Ôδ±ê¼ÇΪ¿É°²È«Ö´ÐеÄActiveX
½Å±¾µÄÔËÐД¡£
ÕâÀïÖ÷ҪȡÁËCPU¡¢Äڴ漰ϵͳÓû§¼¸¸öÐÅÏ¢£¬´ó¼ÒÀûÓÃWMIµÄAPI»òÕß½èÖúJSEDIT»ñÈ¡
µ½¸ü¶àµÄÐÅÏ¢¡£ÏÂÃæÁгöÁ˳£ÓÃÐÅÏ¢µÄÀࣺ
Win32_Processor // CPU ´¦ÀíÆ÷
Win32_PhysicalMemory // ÎïÀíÄÚ´æ
Win32_Keyboard // ¼üÅÌ
Win32_PointingDevice // µãÊäÈëÉ豸£¬ÈçÊó±ê
Win32_DiskDrive // Ó²ÅÌÇý¶¯Æ÷
Win32_CDROMDrive // ¹âÅÌÇý¶¯Æ÷
Win32_BaseBoard // Ö÷°å
Win32_BIOS // BIOS оƬ
Win32_ParallelPort // ²¢¿Ú
Win32_SerialPort // ´®¿Ú
Win32_SoundDevice // ¶àýÌåÉèÖÃ
Win32_USBController // USB ¿ØÖÆÆ÷
Win32_NetworkAdapter // ÍøÂçÊÊÅäÆ÷
Ïà¹ØÎĵµ£º
½ûֹѡÔñ
unselectable="on"(off): IE/Opera
style="-moz-user-select:none": FireFox(JS:element.style.MozUserSelect = "none";)
style="-khtml-user-select:none": Safari(JS:element.style.KhtmlUserSelect)
ons ......
Chrome ÓµÓиü¿ìËÙµÄJavaScript£»
±àдÈçÏÂС³ÌÐò£º
<html>
<script language = "javascript">
var sum = 0;
var start = new Date;
for(var i = 0; i < 1000001; i++){
sum+=i;
}
var stop = new Date;
document.write("´Ó1µ½1000000µÄÀÛ¼Ó½á¹û£º" + sum + ";" + "<br/> ......
Ò»£¬Ç°ÑÔ
CookiesÏë±ØËùÓÐÈ˶¼Á˽⣬ µ«ÊÇδ±ØËùÓÐÈ˶¼¾«Í¨¡£±¾ÎĽ²½âÁËCookiesµÄ¸÷·½Ãæ֪ʶ£¬ ²¢ÇÒÌá³öÀ´ÁË×î¼Ñʵ¼ù¡£ÕâÊDZÊÕßÔÚÈÕ³£¹¤×÷ÖеĻýÀۺͳÁµí¡£
¶þ£¬»ù´¡ÖªÊ¶
1.ʲôÊÇCookies
Cookie ÊÇһС¶ÎÎı¾ÐÅÏ¢£¬°éËæ×ÅÓû§ÇëÇóºÍÒ³ÃæÔÚ Web ·þÎñÆ÷ºÍä¯ÀÀÆ÷Ö®¼ä´«µÝ¡£Cookie °üº¬Ã¿´ÎÓû§·ÃÎÊÕ¾µãʱ Web Ó¦ÓóÌÐò¶¼¿ ......
W3SchoolÊÇÒ»¸öºÜºÃµÄ³õѧÕßѧϰÍøÕ¾¡£ÏÂÃæµÄÊÇÀïÃæµÄÄÚÈÝ£¬Ö÷ÒªÊÇjavascript¶ÔÏóµÄAPI˵Ã÷ÓëʹÓã¬Ï£ÍûÔÚ²»¶®µÄʱºò¿ÉÒԺܷ½±ãµØ²é¿´µ½ËùÐèÒªµÄÒÉÎÊ¡£
JavaScript String ¶ÔÏó²Î¿¼ÊÖ²á
http://www.w3school.com.cn/js/jsref_obj_string.asp
JavaScript Date ¶ÔÏó²Î¿¼ÊÖ²á
http://www.w3school.com.cn/js/jsref_obj_dat ......
¼¸ºõËùÓеĸ» Web Ó¦Óö¼»ùÓÚÒ»¸ö»ò¶à¸ö Web UI ¿â»ò¿ò¼Ü£¬ÕâЩ UI
¿âÓë¿ò¼Ü¼«´óµØ¼ò»¯ÁË¿ª·¢½ø³Ì£¬²¢´øÀ´Ò»Ö£¬¿É¿¿£¬ÒÔ¼°¸ß¶È½»»¥ÐÔµÄÓû§½çÃæ¡£±¾ÎĽéÉÜÁË 15 ¸ö·Ç³£Ç¿´óµÄ JavaScript Web UI
¿â£¬·Ç³£Êʺϸ÷ÖÖ¸÷ÖÖ¹æÄ£µÄ¸» Web Ó¦ÓõĿª·¢¡£
LivePipe
LivePipe
UI
»ùÓÚ Prototype Javascript ¿ò¼Ü
£¬°üº ......