FolderItem.IsFolder 속성
항목이 폴더인지를 나타냅니다.
이 속성은 읽기 전용입니다.
구문
bIsFolder = FolderItem.IsFolder
속성 값
항목이 폴더이면 true를 수신하고 그렇지 않으면 false를 수신하는 부울입니다.
예제
다음 예제에서는 IsFolder 를 사용하여 Windows 디렉터리가 폴더인지 여부를 확인합니다. JScript, VBScript 및 Visual Basic에 대한 적절한 사용법이 표시됩니다.
Jscript:
<script language="JScript">
function fnIsFolderJ()
{
var objShell = new ActiveXObject("shell.application");
var objFolder2;
var ssfWINDOWS = 36;
objFolder2 = objShell.NameSpace(ssfWINDOWS);
if (objFolder2 != null)
{
var objFolderItem;
objFolderItem = objFolder2.Self;
if (objFolderItem != null)
{
var bReturn;
bReturn = objFolderItem.IsFolder;
}
}
}
</script>
Vbscript:
<script language="VBScript">
function fnIsFolderVB()
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.Self
if (not objFolderItem is nothing) then
dim bReturn
bReturn = objFolderItem.IsFolder
end if
set objFolderItem = nothing
end if
set objFolder2 = nothing
end if
set objShell = nothing
end function
</script>
Visual Basic:
Private Sub fnIsFolderVB()
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.Self
If (Not objFolderItem Is Nothing) Then
Dim bReturn As Boolean
bReturn = objFolderItem.IsFolder
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
요구 사항
요구 사항 | 값 |
---|---|
지원되는 최소 클라이언트 |
Windows 2000 Professional, Windows XP [데스크톱 앱만 해당] |
지원되는 최소 서버 |
Windows 2000 Server[데스크톱 앱만] |
헤더 |
|
IDL |
|
DLL |
|