ÆÄÀÏ¿¡¼´Â ÁöÁ¤ÇÑ ÆÄÀÏÀ̳ª Æú´õÀÇ Å©±â¸¦ ¹ÙÀÌÆ® ´ÜÀ§·Î ¹ÝȯÇÑ´Ù.
ÇʼöÀûÀÎ ¿ä¼ÒÀ̸ç, Ç×»ó object´Â File ¶Ç´Â Folder °³Ã¼ÀÌ´Ù.
ÀÌ ¼Ó¼ºÀº ÀбâÀü¿ëÀÌ¸ç µðÆúÆ®°ªÀº ¾ø´Ù.
<SCRIPT language=JScript> function SizeTest(filePath){ var fso, folderObj,str; fso=new ActiveXObject('Scripting.FileSystemObject'); if (!fso.FileExists(filePath)){ // ¿À·ù ¹æÁö¸¦ À§ÇÏ¿© ÈÀÏÀÌ ¾øÀ¸¸é »ý¼ºÇÑ´Ù. fileObj=fso.OpenTextFile(filePath,2,true); fileObj.Write(filePath+' ÈÀÏ'); fileObj.Close(); } fileObj=fso.GetFile(filePath); folderObj=fileObj.ParentFolder str=fileObj.Path+'Àº(´Â) '+fileObj.size+'¹ÙÀÌÆ® »ç¿ëÇÑ´Ù.<BR>'; str+=folderObj.Path+'Àº(´Â) '+folderObj.size+'¹ÙÀÌÆ® »ç¿ëÇÑ´Ù.<BR>'; return(str); } </SCRIPT> <DIV id=showjs class=show alt="°á°ú">°á°ú Ç¥½Ãâ</DIV> <DIV class=show onClick="showjs.innerHTML=SizeTest('C:\\JsTest\\expSample.txt')"> <SPAN class=ie>JScript</SPAN> <SPAN class=property>Size</SPAN> ¼Ó¼º ¿¹Á¦</DIV>
<SCRIPT language=VBScript> function SizeTestvb(filePath) Dim fso,folderObj,str Set fso=CreateObject("Scripting.FileSystemObject") If Not fso.FileExists(filePath) Then ' ¿À·ù ¹æÁö¸¦ À§ÇÏ¿© ¿øº» ÈÀÏÀÌ ¾øÀ¸¸é »ý¼ºÇÑ´Ù. Set fileObj=fso.OpenTextFile(filePath,2,true) fileObj.Write filePath&" ÈÀÏ" fileObj.Close End If Set fileObj=fso.GetFile(filePath) Set folderObj=fileObj.ParentFolder str=fileObj.Path&"Àº(´Â) "&fileObj.size&"¹ÙÀÌÆ® »ç¿ëÇÑ´Ù.<BR>" str=str&folderObj.Path&"Àº(´Â) "&folderObj.size&"¹ÙÀÌÆ® »ç¿ëÇÑ´Ù.<BR>" SizeTestvb=str End Function </SCRIPT> <DIV id=showvb class=show alt="°á°ú">°á°ú Ç¥½Ãâ</DIV> <DIV class=show onClick="showvb.innerHTML=SizeTestvb('C:\\JsTest\\expSample.txt')"> <SPAN class=ie>VBScript</SPAN> <SPAN class=property>Size</SPAN> ¼Ó¼º ¿¹Á¦</DIV>