Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

JavascriptÎļþ¼°Îļþ¼Ð²Ù×÷

JavascriptÎļþ¼°Îļþ¼Ð²Ù×÷
 
Ò»¡¢¹¦ÄÜʵÏÖºËÐÄ£ºFileSystemObject ¶ÔÏó
    ÒªÔÚjavascriptÖÐʵÏÖÎļþ²Ù×÷¹¦ÄÜ£¬Ö÷Òª¾ÍÊÇÒÀ¿¿FileSystemobject¶ÔÏó¡£
¶þ¡¢FileSystemObject±à³Ì
ʹÓÃFileSystemObject ¶ÔÏó½øÐбà³ÌºÜ¼òµ¥£¬Ò»°ãÒª¾­¹ýÈçϵIJ½Ö裺 ´´½¨FileSystemObject¶ÔÏó¡¢Ó¦ÓÃÏà¹Ø·½·¨¡¢·ÃÎʶÔÏóÏà¹ØÊôÐÔ ¡£
£¨Ò»£©´´½¨FileSystemObject¶ÔÏó
´´½¨FileSystemObject¶ÔÏóµÄ´úÂëÖ»Òª1ÐУº
var fso = new ActiveXObject("Scripting.FileSystemObject");
ÉÏÊö´úÂëÖ´Ðкó£¬fso¾Í³ÉΪһ¸öFileSystemObject¶ÔÏóʵÀý¡£
£¨¶þ£©Ó¦ÓÃÏà¹Ø·½·¨
´´½¨¶ÔÏóʵÀýºó£¬¾Í¿ÉÒÔʹÓöÔÏóµÄÏà¹Ø·½·¨ÁË¡£±ÈÈ磬ʹÓÃCreateTextFile·½·¨´´½¨Ò»¸öÎı¾Îļþ£º
var fso = new ActiveXObject("Scripting.FileSystemObject");
var f1 = fso.createtextfile("c:\\myjstest.txt",true");
£¨Èý£©·ÃÎʶÔÏóÏà¹ØÊôÐÔ
Òª·ÃÎʶÔÏóµÄÏà¹ØÊôÐÔ£¬Ê×ÏÈÒª½¨Á¢Ö¸Ïò¶ÔÏóµÄ¾ä±ú£¬Õâ¾ÍҪͨ¹ýgetϵÁз½·¨ÊµÏÖ£ºGetDrive¸ºÔð»ñÈ¡Çý¶¯Æ÷ÐÅÏ¢£¬GetFolder¸ºÔð»ñÈ¡Îļþ¼ÐÐÅÏ¢£¬GetFile¸ºÔð»ñÈ¡ÎļþÐÅÏ¢¡£±ÈÈ磬ָÏòÏÂÃæµÄ´úÂëºó£¬f1¾Í³ÉΪָÏòÎļþc:\test.txtµÄ¾ä±ú£º
var fso = new ActiveXObject("Scripting.FileSystemObject");
var f1 = fso.GetFile("c:\\myjstest.txt");
È»ºó£¬Ê¹ÓÃf1·ÃÎʶÔÏóµÄÏà¹ØÊôÐÔ¡£±ÈÈ磺
var fso = new ActiveXObject("Scripting.FileSystemObject");
var f1 = fso.GetFile("c:\\myjstest.txt");
alert("File last modified: " + f1.DateLastModified);
Ö´ÐÐÉÏÃæ×îºóÒ»¾äºó£¬½«ÏÔʾc:\myjstest.txtµÄ×îºóÐÞ¸ÄÈÕÆÚÊôÐÔÖµ¡£
µ«ÓÐÒ»µãÇë×¢Ò⣺¶ÔÓÚʹÓÃcreate·½·¨½¨Á¢µÄ¶ÔÏ󣬾Ͳ»±ØÔÙʹÓÃget·½·¨»ñÈ¡¶ÔÏó¾ä±úÁË£¬Õâʱֱ½ÓʹÓÃcreate·½·¨½¨Á¢µÄ¾ä±úÃû³Æ¾Í¿ÉÒÔ£º
var fso = new ActiveXObject("Scripting.FileSystemObject");
var f1 = fso.createtextfile("c:\\myjstest.txt",true");
alert("File last modified: " + f1.DateLastModified);
Èý¡¢²Ù×÷Çý¶¯Æ÷£¨Drives£©
ʹÓÃFileSystemObject¶ÔÏóÀ´±à³Ì²Ù×÷Çý¶¯Æ÷£¨Drives£©ºÍÎļþ¼Ð£¨Folders£©ºÜÈÝÒ×£¬Õâ¾ÍÏóÔÚWindowsÎļþä¯ÀÀÆ÷ÖжÔÎļþ½øÐн»»¥²Ù×÷Ò»Ñù£¬±ÈÈ磺¿½±´¡¢Òƶ¯Îļþ¼Ð£¬»ñÈ¡Îļþ¼ÐµÄÊôÐÔ¡£
£¨Ò»£©Drives¶ÔÏóÊôÐÔ
Drive¶ÔÏó¸ºÔðÊÕ¼¯ÏµÍ³ÖеÄÎïÀí»òÂß¼­Çý¶¯Æ÷×ÊÔ´ÄÚÈÝ£¬Ëü¾ßÓÐÈçÏÂÊôÐÔ£º
l TotalSize£ºÒÔ×Ö½Ú£¨byte£©Îªµ¥Î»¼ÆËãµÄÇý¶¯


Ïà¹ØÎĵµ£º

[·­Òë]High Performance JavaScript(030)

µÚʮՠ Tools  ¹¤¾ß
    Having the right software is essential for identifying bottlenecks in both the loading and running of scripts. A number of browser vendors and large-scale websites have shared techniques and tools to help make the Web faster and more efficient. This ......

[·­Òë]High Performance JavaScript(033)

Summary  ×ܽá
    When web pages or applications begin to feel slow, analyzing assets as they come over the wire and profiling scripts while they are running allows you to focus your optimization efforts where they are needed most.
    µ±ÍøÒ³»òÓ¦ÓóÌÐò±äÂýʱ£¬·ÖÎ ......

ÈçºÎÎÒjavaScript»ñÈ¡´°¿ÚµÄ¸ß¶ÈºÍ¿í¶È

ÔÚjavascriptÖеõ½µ±Ç°´°¿ÚµÄ¸ßºÍ¿í
<body><SCRIPT LANGUAGE="JavaScript">
var  s = "";
s += "\r\nÍøÒ³¿É¼ûÇøÓò¿í£º"+ document.body.clientWidth;
s += "\r\nÍøÒ³¿É¼ûÇøÓò¸ß£º"+ document.body.clien ......

jLayout — JavaScript Layout Algorithms


The jLayout JavaScript library provides layout algorithms for laying out components. A component is an abstraction; it can be implemented in many ways, for example as items in a HTML5 Canvas drawing or as HTML elements. The jLayout library allows you to focus on drawing the individual components i ......

JavaScript ¶ÁÈ¡ JSON


JSON:
[{"subjecttypeId":"1","subjectName":"67","scope":"1",},{"subjecttypeId":"1","subjectName":"345","scope":"1"}]
JavaScript:
       var result = window.eval('(' + JSON+ ')');

for(var p in result){

result[p].subjectName;

alert(result[p] ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ