FileProtectionManager.ProtectAsync(IStorageItem, String) メソッド

定義

注意

2022 年 7 月以降、Microsoft は Windows Information Protection (WIP) と WIP をサポートする API を非推奨にしています。 Microsoft は、サポートされているバージョンの Windows で WIP を引き続きサポートします。 Windows の新しいバージョンには WIP の新機能は含まれません。また、今後のバージョンの Windows ではサポートされません。 詳細については、「Windows Information Protectionの終了を発表する」を参照してください。

データ保護のニーズに合わせて、Microsoft Purview 情報保護Microsoft Purview データ損失防止を使用することをお勧めします。 Purview を使用すると、構成のセットアップが簡略化され、高度な機能セットが提供されます。

ファイル内のデータをエンタープライズ ID に保護します。 その後、アプリは標準 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

エンタープライズ ID。 これは、管理されているメール アドレスまたはドメインです。 ProtectionPolicyManager.IsIdentityManaged を使用して、ID を使用してファイルを保護する前に、メール アドレスまたはドメインが管理されていることを確認します。

戻り値

このメソッドの呼び出しが正常に完了すると、新しく保護されたファイルの状態を含む FileProtectionInfo オブジェクトが返されます。

属性

Windows の要件

アプリの機能
enterpriseDataPolicy

適用対象

こちらもご覧ください