FolderItem.IsBrowsable 属性
指示项是否可以托管在浏览器或 Windows 资源管理器框架中。
此属性为只读。
语法
bIsBrowsable = FolderItem.IsBrowsable
属性值
一个 布尔值 ,如果可以浏览项,则接收 true ;否则,则为 false 。
示例
以下示例使用 IsBrowsable 确定 Windows 文件夹的可浏览状态。 显示 JScript、VBScript 和 Visual Basic 的正确用法。
Jscript:
<script language="JScript">
function fnIsBrowsableJ()
{
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.IsBrowsable;
}
}
}
</script>
VBScript:
<script language="VBScript">
function fnIsBrowsableVB()
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.IsBrowsable
end if
set objFolderItem = nothing
end if
set objFolder2 = nothing
end if
set objShell = nothing
end function
</script>
Visual Basic:
Private Sub fnIsBrowsableVB()
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.IsBrowsable
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 专业版、Windows XP [仅限桌面应用] |
最低受支持的服务器 |
Windows 2000 Server [仅限桌面应用] |
标头 |
|
IDL |
|
DLL |
|