ProtectionPolicyManager.IsFileProtectionRequiredForNewFileAsync 方法

定義

注意

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

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

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

public:
 static IAsyncOperation<bool> ^ IsFileProtectionRequiredForNewFileAsync(IStorageFolder ^ parentFolder, Platform::String ^ identity, Platform::String ^ desiredName);
/// [Windows.Foundation.Metadata.RemoteAsync]
 static IAsyncOperation<bool> IsFileProtectionRequiredForNewFileAsync(IStorageFolder const& parentFolder, winrt::hstring const& identity, winrt::hstring const& desiredName);
[Windows.Foundation.Metadata.RemoteAsync]
public static IAsyncOperation<bool> IsFileProtectionRequiredForNewFileAsync(IStorageFolder parentFolder, string identity, string desiredName);
function isFileProtectionRequiredForNewFileAsync(parentFolder, identity, desiredName)
Public Shared Function IsFileProtectionRequiredForNewFileAsync (parentFolder As IStorageFolder, identity As String, desiredName As String) As IAsyncOperation(Of Boolean)

參數

parentFolder
IStorageFolder

包含您要知道是否要保護之檔案的資料夾。

identity
String

Platform::String

winrt::hstring

企業身分識別。

重要

由於此屬性的目前實作有錯誤,請將企業身分識別傳遞至 desiredName 參數。

desiredName
String

Platform::String

winrt::hstring

您想要提供檔案的名稱。

重要

由於這個屬性的目前實作有錯誤,請將此名稱傳遞至 identity 參數。

傳回

如果此資料夾中的檔案應受到保護,則為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 引進)

備註

請參閱此方法的備註一節: IsFileProtectionRequiredAsync

適用於