发信人: wuga(冰雨梦)
整理人: wuga(2001-12-20 13:58:41), 站内信件
|
描述
返回集合中的当前项。
语法
myEnum.item( )
myEnum 参数是任意 Enumerator 对象。
返回值
item 方法返回当前项。 如果集合为空或者当前项没有定义,那么将返回 undefined 。
说明
在下面的代码中,使用了 item 方法返回 Drives 集合中的一个成员:
function ShowDriveList()
{
var fso, s, n, e, x;
fso = new ActiveXObject("Scripting.FileSystemObject");
e = new Enumerator(fso.Drives);
s = "";
for (; !e.atEnd(); e.moveNext())
{
x = e.item();
s = s + x.DriveLetter;
s += " - ";
if (x.DriveType == 3)
n = x.ShareName;
else if (x.IsReady)
n = x.VolumeName;
else
n = "[驱动器未就绪]";
s += n + "<br>";
}
return(s);
}
|
|