ÁöÁ¤ÇÑ ÆÄÀÏÀ̳ª Æú´õÀÇ »óÀ§ Æú´õ¿¡ ÇØ´çÇÏ´Â Æú´õ °³Ã¼¸¦ ¹ÝȯÇÑ´Ù. ÀбâÀü¿ëÀÌ´Ù.
ÁöÁ¤ÇÑ ÆÄÀÏÀ̳ª Æú´õÀÇ ¹Ù·Î »óÀ§ Æú´õ¿¡ ÇØ´çÇÏ´Â Æú´õ °³Ã¼¸¦ ¹ÝȯÇÑ´Ù.
ÀÌ ¼Ó¼ºÀº ÀбâÀü¿ëÀÌ¸ç µðÆúÆ®°ªÀº ¾ø´Ù.
<SCRIPT language=JScript> function ParentFolderTest(filePath){ var fso,fileObj,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='File "'+fileObj.Name+'"Àº "'+folderObj+'" Folder¿¡ ÀÖ´Ù.<BR><BR>'; str+='File: "'+fileObj+'"<BR>'; str+='File ¸¸µç ³¯Â¥: '+fileObj.DateCreated+'<BR>'; str+='File ¸¶Áö¸·À¸·Î ¼öÁ¤ÇÑ ³¯Â¥: '+fileObj.DateLastModified+'<BR><BR>'; str+='ParentFolder: "'+folderObj+'"<BR>'; str+='Folder ¸¸µç ³¯Â¥: '+folderObj.DateCreated+'<BR>'; str+='Folder ¸¶Áö¸·À¸·Î ¼öÁ¤ÇÑ ³¯Â¥: '+fileObj.DateLastModified+'<BR><BR>'; str+='ParentFolderÀÇ ParentFolder: "'+folderObj.ParentFolder+'"<BR>'; return(str); } </SCRIPT> <DIV id=showjs class=show alt="°á°ú">°á°ú Ç¥½Ãâ</DIV> <DIV class=show onClick="showjs.innerHTML=ParentFolderTest('C:\\JsTest\\expSample.txt')"> <SPAN class=ie>JScript</SPAN><SPAN class=property>ParentFolder</SPAN> ¼Ó¼º ¿¹Á¦</DIV>
<SCRIPT language=VBScript> function ParentFolderTestvb(filePath) Dim fso,fileObj,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="File '"&fileObj.Name&"'Àº '"&folderObj&"' Folder¿¡ ÀÖ´Ù.<BR><BR>" str=str&"File: '"&fileObj&"'<BR>" str=str&"File ¸¸µç ³¯Â¥: "&fileObj.DateCreated&"<BR>" str=str&"File ¸¶Áö¸·À¸·Î ¼öÁ¤ÇÑ ³¯Â¥: "&fileObj.DateLastModified&"<BR><BR>" str=str&"ParentFolder: '"&folderObj&"'<BR>" str=str&"Folder ¸¸µç ³¯Â¥: "&folderObj.DateCreated&"<BR>" str=str&"Folder ¸¶Áö¸·À¸·Î ¼öÁ¤ÇÑ ³¯Â¥: "&fileObj.DateLastModified&"<BR><BR>" str=str&"ParentFolderÀÇ ParentFolder: '"&folderObj.ParentFolder&"'<BR>" ParentFolderTestvb=str End Function </SCRIPT> <DIV id=showvb class=show alt="°á°ú">°á°ú Ç¥½Ãâ</DIV> <DIV class=show onClick="showvb.innerHTML=ParentFolderTestvb('C:\\JsTest\\expSample.txt')"> <SPAN class=ie>VBScript</SPAN><SPAN class=property>ParentFolder</SPAN> ¼Ó¼º ¿¹Á¦</DIV>