FileDialogPermissionAttribute.Open 属性
获取或设置一个值,该值指示是否声明了通过文件对话框打开文件的权限。
**命名空间:**System.Security.Permissions
**程序集:**mscorlib(在 mscorlib.dll 中)
语法
声明
Public Property Open As Boolean
用法
Dim instance As FileDialogPermissionAttribute
Dim value As Boolean
value = instance.Open
instance.Open = value
public bool Open { get; set; }
public:
property bool Open {
bool get ();
void set (bool value);
}
/** @property */
public boolean get_Open ()
/** @property */
public void set_Open (boolean value)
public function get Open () : boolean
public function set Open (value : boolean)
属性值
如果声明了通过文件对话框打开文件的权限,则为 true;否则为 false。
示例
' This method demonstrates PermitOnly with the Open property set to true.
<FileDialogPermissionAttribute(SecurityAction.PermitOnly, Open:=True)> _
Public Shared Sub PermitOnlyMethod()
Console.WriteLine("Executing PermitOnlyMethod.")
Console.WriteLine("PermitOnly the Open permission.")
PermitOnlyTest()
End Sub 'PermitOnlyMethod
// This method demonstrates PermitOnly with the Open property set to true.
[FileDialogPermissionAttribute(SecurityAction.PermitOnly, Open = true)]
public static void PermitOnlyMethod()
{
Console.WriteLine("Executing PermitOnlyMethod.");
Console.WriteLine("PermitOnly the Open permission.");
PermitOnlyTest();
}
// This method demonstrates PermitOnly with the Open property set to true.
[FileDialogPermissionAttribute(SecurityAction::PermitOnly,Open=true)]
void PermitOnlyMethod()
{
Console::WriteLine( "Executing PermitOnlyMethod." );
Console::WriteLine( "PermitOnly the Open permission." );
PermitOnlyTest();
}
// This method demonstrates PermitOnly with the Open property set to true.
/** @attribute FileDialogPermissionAttribute(SecurityAction.PermitOnly,
Open = true)
*/
public static void PermitOnlyMethod()
{
Console.WriteLine("Executing PermitOnlyMethod.");
Console.WriteLine("PermitOnly the Open permission.");
PermitOnlyTest();
} //PermitOnlyMethod
平台
Windows 98、Windows 2000 SP4、Windows Millennium Edition、Windows Server 2003、Windows XP Media Center Edition、Windows XP Professional x64 Edition、Windows XP SP2、Windows XP Starter Edition
.NET Framework 并不是对每个平台的所有版本都提供支持。有关受支持版本的列表,请参见系统要求。
版本信息
.NET Framework
受以下版本支持:2.0、1.1、1.0
请参见
参考
FileDialogPermissionAttribute 类
FileDialogPermissionAttribute 成员
System.Security.Permissions 命名空间