Scripting Runtime Library(FileSystemObject)

Scripting Runtime Library¿¡¼­ »ç¿ëÇÒ ¼ö ÀÖ´Â ¸ðµç µå¶óÀ̺êÀÇ Àбâ Àü¿ë Ä÷º¼ÇÀÌ´Ù.

[]=fsoName.Drives
Àμö
: (Ä÷º¼Ç À̸§)
¼±ÅÃÀûÀÎ ¿ä¼ÒÀ̸ç System¾ÈÀÇ ¸ðµç Drive °³Ã¼µéÀÇ ÁýÇÕü¸¦ ÂüÁ¶ÇÑ´Ù.
fsoName : (°³Ã¼¸í)
FileSystemObject °³Ã¼ÀÇ À̸§ÀÌ´Ù.
Drives : (µå¶óÀ̺ê Ä÷º¼Ç)
ÇʼöÀû ¿ä¼ÒÀ̸ç FileSystemObject °³Ã¼ÀÇ fsoName.Drives ¼Ó¼º¸¦ »ç¿ëÇÏ¿© ¿¬°áµÈ ¸ðµç µå¶óÀ̺êµéÀÇ Ä÷º¼Ç Á¤º¸¸¦ °¡Á®¿Â´Ù.
¼³¸í

Àбâ Àü¿ë Ä÷º¼ÇÀÌ´Ù.

mediaObj

.Count·Î °¹¼ö¸¦ ¾Ë¼ö ÀÖ°í, .Item(keyVal)À¸·Î ÇØ´ç µå¶óÀ̺긦 ÂüÁ¶ÇÒ ¼ö ÀÖ´Ù.

Drives Ä÷º¼Ç¿¡ À̵¿½Ä ¸Åü µå¶óÀ̺긦 Ç¥½ÃÇϱâ À§ÇØ ±× µå¶óÀ̺꿡 ¸Åü¸¦ »ðÀÔÇÒ ÇÊ¿ä´Â ¾ø´Ù.



Drives Ä÷º¼Ç »ç¿ëÇÏ¿© µå¶óÀÌºê ¼Ó¼º¿¡ ¾×¼¼½ºÇÏ´Â ¿¹Á¦

Enumerator °³Ã¼¿Í for ¹®ÀåÀ» »ç¿ëÇÏ¿© ±× Ä÷º¼ÇÀ» ¹Ýº¹ ½ÇÇàÇÏ´Â ¹æ¹ýÀ» º¸¿©ÁØ´Ù.

°á°ú Ç¥½Ãâ
JScript Drives Ä÷º¼Ç ¿¹Á¦
<SCRIPT language=JScript>
function colDrivesTest(){
  var fso,driveName,enumObj,enum1,str='';
  fso=new ActiveXObject('Scripting.FileSystemObject');
  enumObj=new Enumerator(fso.Drives);
  for (; !enumObj.atEnd();enumObj.moveNext()){
    enum1=enumObj.item();
    str=str+enum1.DriveLetter+' - ';
    if (enum1.DriveType==3) driveName=enum1.ShareName ;
    else if (enum1.IsReady) driveName=enum1.VolumeName;
    else driveName='[µå¶óÀ̺갡 ÁغñµÇÁö ¾Ê¾Ò´Ù.]';
    str+=driveName+'<BR>';
  }
  return(str);
}
</SCRIPT>

<DIV id=showjs class=show alt="°á°ú">°á°ú Ç¥½Ãâ</DIV>
<DIV class=show onClick="id=showjs.innerHTML=colDrivesTest()">
  <SPAN class=ie>JScript</SPAN> <SPAN class=collection>Drives</SPAN> Ä÷º¼Ç ¿¹Á¦</DIV>

VBScript·Î Files Ä÷º¼ÇÀ» °¡Á®¿Í¼­ For Each...Next ¹®ÀåÀ» »ç¿ëÇÏ¿© µ¿ÀÏÇÑ ³»¿ëÀ» º¸¿©ÁØ´Ù.

°á°ú Ç¥½Ãâ
JScript Drives Ä÷º¼Ç ¿¹Á¦
<SCRIPT language=VBScript>
Function colDrivesTestvb
  Dim fso,driveObj,drivecol,str,driveName
  Set fso=CreateObject("Scripting.FileSystemObject")
  Set drivecol=fso.Drives
  For Each driveObj in drivecol
    driveName="[µå¶óÀ̺갡 ÁغñµÇÁö ¾Ê¾Ò´Ù.]"
    str=str & driveObj.DriveLetter & " - "
    If driveObj.DriveType=3 Then
      driveName=driveObj.ShareName
    Elseif driveObj.IsReady Then
      driveName=driveObj.VolumeName
    End If
    str=str & driveName & "<BR>"
  Next
  colDrivesTestvb=str
End Function
</SCRIPT>

<DIV id=showvb class=show alt="°á°ú">°á°ú Ç¥½Ãâ</DIV>
<DIV class=show onClick="id=showvb.innerHTML=colDrivesTestvb()">
  <SPAN class=ie>JScript</SPAN> <SPAN class=collection>Drives</SPAN> Ä÷º¼Ç ¿¹Á¦</DIV>

¿¹Á¦Count ¼Ó¼º IE4 -
¢¡ Drives Ä÷º¼Ç °³Ã¼ÀÇ Ç׸ñ ¼ö¸¦ ¹ÝȯÇÑ´Ù. Àбâ Àü¿ëÀÌ´Ù.
¹®¹ý: [iVal=].Count
¿¹Á¦Item ¼Ó¼º IE4 -
¢¡ Drives Ä÷º¼Ç¿¡¼­ ÁöÁ¤ÇÑ idValÀ» ±â¹ÝÀ¸·Î ÇÏ´Â Ç׸ñ( oVal)À» ¹ÝȯÇÑ´Ù. Àбâ/¾²±â°¡ °¡´ÉÇÏ´Ù.
¹®¹ý: .Item(idVal)[=oVal]

Drives Ä÷º¼Ç¿¡´Â ¸Þ¼­µå°¡ ¾ø´Ù.