ProtectionPolicyManager.IsFileProtectionRequiredAsync 方法

定義

注意

從 2022 年 7 月開始,Microsoft 即將淘汰 Windows 資訊保護 (WIP) ,以及支援 WIP 的 API。 Microsoft 將繼續在支援的 Windows 版本上支援 WIP。 新版本的 Windows 不會包含 WIP 的新功能,且未來版本的 Windows 不支援此功能。 如需詳細資訊,請參閱宣佈 Windows 資訊保護的終止

針對資料保護需求,Microsoft 建議您使用Microsoft Purview 資訊保護Microsoft Purview 資料外洩防護。 Purview 簡化了組態設定,並提供一組進階的功能。

指出檔案是否需要受到企業身分識別的保護。

public:
 static IAsyncOperation<bool> ^ IsFileProtectionRequiredAsync(IStorageItem ^ target, Platform::String ^ identity);
/// [Windows.Foundation.Metadata.RemoteAsync]
 static IAsyncOperation<bool> IsFileProtectionRequiredAsync(IStorageItem const& target, winrt::hstring const& identity);
[Windows.Foundation.Metadata.RemoteAsync]
public static IAsyncOperation<bool> IsFileProtectionRequiredAsync(IStorageItem target, string identity);
function isFileProtectionRequiredAsync(target, identity)
Public Shared Function IsFileProtectionRequiredAsync (target As IStorageItem, identity As String) As IAsyncOperation(Of Boolean)

參數

target
IStorageItem

您想要知道是否要保護的檔案。

identity
String

Platform::String

winrt::hstring

企業身分識別。

傳回

如果檔案應受到保護,則為true,否則為 false

屬性

Windows 需求

裝置系列
Windows Desktop Extension SDK (已於 10.0.15063.0 引進)
Windows Mobile Extension SDK (已於 10.0.15063.0 引進)
API contract
Windows.Security.EnterpriseData.EnterpriseDataContract (已於 v4.0 引進)

備註

您的程式碼可以呼叫此方法,以避免加密不需要加密的檔案,例如 exe、dll 和其他組建成品。 這可降低電腦其他使用者無法存取這些檔案的風險,並降低不必要加密檔案的效能成本。

適用於