MediaPermissionAttribute(SecurityAction) 构造函数

定义

初始化 MediaPermissionAttribute 的新实例。

public:
 MediaPermissionAttribute(System::Security::Permissions::SecurityAction action);
public MediaPermissionAttribute (System.Security.Permissions.SecurityAction action);
new System.Security.Permissions.MediaPermissionAttribute : System.Security.Permissions.SecurityAction -> System.Security.Permissions.MediaPermissionAttribute
Public Sub New (action As SecurityAction)

参数

action
SecurityAction

SecurityAction 值之一。

示例

下面的代码示例演示如何创建 MediaPermissionAttribute

[MediaPermissionAttribute(SecurityAction.Demand)]
<MediaPermissionAttribute(SecurityAction.Demand)>
Public Sub Method12a()
    Dim mpa As New MediaPermissionAttribute(SecurityAction.Demand)
End Sub

注解

默认媒体值为 AllAudioNoImageNoVideo

适用于