FileProtectionManager.ProtectAsync(IStorageItem, String) 方法

定義

注意

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

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

將檔案中的資料保護為企業身分識別。 然後,應用程式可以使用標準 API 從檔案讀取或寫入。

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

參數

target
IStorageItem

要保護的檔案。

identity
String

Platform::String

winrt::hstring

企業身分識別。 這是受控的電子郵件地址或網域。 使用 ProtectionPolicyManager.IsIdentityManaged 確認使用身分識別保護檔案之前,已管理電子郵件地址或網域。

傳回

當這個方法的呼叫成功完成時,它會傳回 FileProtectionInfo 物件,其中包含新受保護檔案的狀態。

屬性

Windows 需求

應用程式功能
enterpriseDataPolicy

適用於

另請參閱