FolderItemVerbs.Count 屬性
包含集合中的專案數目。
這個屬性是唯讀的。
Syntax
iCount = FolderItemVerbs.Count
屬性值
接收Count屬性的Integer。
範例
下列範例會使用Count來擷取主控台資料夾可用的動詞計數。 JScript、VBScript 和 Visual Basic 會顯示適當的使用方式。
Jscript:
<script language="JScript">
function fnFolderItemVerbsCountJ()
{
var objShell = new ActiveXObject("shell.application");
var objFolder2;
var ssfCONTROLS = 3;
objFolder2 = objShell.NameSpace(ssfCONTROLS);
if (objFolder2 != null)
{
var objVerbs;
objVerbs = objFolder2.Self.Verbs();
if (objVerbs != null)
{
var nCount;
nCount = objVerbs.Count;
alert(nCount);
}
}
}
</script>
VBScript:
<script language="VBScript">
function fnFolderItemsCountVB()
dim objShell
set objShell = CreateObject("shell.application")
if (not objShell is nothing) then
dim objFolder
dim ssfWINDOWS
ssfWINDOWS = 36
set objFolder = objShell.NameSpace(ssfWINDOWS)
if (not objFolder is nothing) then
dim objFolderItems
set objFolderItems = objFolder.Items()
if (not objFolderItems is nothing) then
dim nCount
nCount = objFolderItems.Count
alert(nCount)
end if
set objFolderItems = nothing
end if
set objFolder = nothing
end if
set objShell = nothing
end function
</script>
Visual Basic:
Private Sub fnFolderItemsCountVB()
Dim objShell As Shell
Dim objFolder As Folder
Dim ssfWINDOWS As Long
ssfWINDOWS = 36
Set objShell = New Shell
Set objFolder = objShell.NameSpace(ssfWINDOWS)
If (Not objFolder Is Nothing) Then
Dim objFolderItems As FolderItems
Set objFolderItems = objFolder.Items
If (Not objFolderItems Is Nothing) Then
Dim nCount As Integer
nCount = objFolderItems.Count
Debug.Print nCount
End If
Set objFolderItems = Nothing
End If
Set objFolder = Nothing
Set objShell = Nothing
End Sub
規格需求
需求 | 值 |
---|---|
最低支援的用戶端 |
Windows 2000 專業版、Windows XP [僅限傳統型應用程式] |
最低支援的伺服器 |
Windows 2000 Server [僅限傳統型應用程式] |
標頭 |
|
Idl |
|
DLL |
|