FolderItem.Size, proprietà
Contiene le dimensioni dell'elemento.
Questa proprietà è di sola lettura.
Sintassi
iSize = FolderItem.Size
Valore proprietà
Intero che riceve le dimensioni dell'elemento.
Esempio
Nell'esempio seguente vengono usate dimensioni per recuperare le dimensioni del file eseguibile del blocco note. L'utilizzo appropriato viene visualizzato per JScript, VBScript e Visual Basic.
Jscript:
<script language="JScript">
function fnFolderItemSizeJ()
{
var objShell = new ActiveXObject("shell.application");
var objFolder2;
var ssfWINDOWS = 36;
objFolder2 = objShell.NameSpace(ssfWINDOWS);
if (objFolder2 != null)
{
var objFolderItem;
objFolderItem = objFolder2.ParseName("NOTEPAD.EXE");
if (objFolderItem != null)
{
var szReturn;
szReturn = objFolderItem.Size;
}
}
}
</script>
Vbscript:
<script language="VBScript">
function fnFolderItemSizeVB()
dim objShell
set objShell = CreateObject("shell.application")
if (not objShell is nothing) then
dim objFolder2
dim ssfWINDOWS
ssfWINDOWS = 36
set objFolder2 = objShell.NameSpace(ssfWINDOWS)
if (not objFolder2 is nothing) then
dim objFolderItem
set objFolderItem = objFolder2.ParseName("NOTEPAD.EXE")
if (not objFolderItem is nothing) then
dim szReturn
szReturn = objFolderItem.Size
end if
set objFolderItem = nothing
end if
set objFolder2 = nothing
end if
set objShell = nothing
end function
</script>
Visual Basic:
Private Sub fnFolderItemSizeVB()
Dim objShell As Shell
Dim objFolder2 As Folder2
Dim ssfWINDOWS As Long
ssfWINDOWS = 36
Set objShell = New Shell
Set objFolder2 = objShell.NameSpace(ssfWINDOWS)
If (Not objFolder2 Is Nothing) Then
Dim objFolderItem As FolderItem
Set objFolderItem = objFolder2.ParseName("NOTEPAD.EXE")
If (Not objFolderItem Is Nothing) Then
Dim szReturn As String
szReturn = objFolderItem.Size
Else
'FolderItem object returned nothing.
End If
Set objFolderItem = Nothing
Else
'Folder object returned nothing.
End If
Set objFolder2 = Nothing
Set objShell = Nothing
End Sub
Requisiti
Requisito | Valore |
---|---|
Client minimo supportato |
Windows 2000 Professional, Windows XP [solo app desktop] |
Server minimo supportato |
Windows 2000 Server [solo app desktop] |
Intestazione |
|
IDL |
|
DLL |
|