MediaPermissionImage 列舉

定義

警告

Code Access Security is not supported or honored by the runtime.

指定影像的使用權限等級。

C#
public enum MediaPermissionImage
C#
[System.Obsolete("Code Access Security is not supported or honored by the runtime.", DiagnosticId="SYSLIB0003", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public enum MediaPermissionImage
繼承
MediaPermissionImage
屬性

欄位

名稱 Description
AllImage 3

允許不受限制之影像顯示的使用權限。

NoImage 0

拒絕所有影像顯示的使用權限。

SafeImage 2

允許安全、有限影像顯示的使用權限,其中包括拒絕串流存取影像檔。

SiteOfOriginImage 1

針對位於應用程式來源網站的影像,才會允許顯示的使用權限。

範例

下列程式碼範例顯示 屬性的使用 Image

C#
[MediaPermissionAttribute(SecurityAction.Demand, Image = MediaPermissionImage.AllImage)]

備註

警告

程式碼存取安全性 (CAS) 在所有版本的 .NET Framework 和 .NET 中已被取代。 使用 CAS 相關 API 時,最新版本的 .NET 不會接受 CAS 批註,並產生錯誤。 開發人員應該尋求替代方式來完成安全性工作。

使用此列舉來設定 Image 類別的 MediaPermission 屬性。 預設值為 SafeImage。

適用於

產品 版本 (已淘汰)
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1 (5, 6, 7, 8, 9)