共用方式為


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

適用於