FileProtectionManager.CreateProtectedAndOpenAsync Method

Definition

Note

Starting in July 2022, Microsoft is deprecating Windows Information Protection (WIP) and the APIs that support WIP. Microsoft will continue to support WIP on supported versions of Windows. New versions of Windows won't include new capabilities for WIP, and it won't be supported in future versions of Windows. For more information, see Announcing sunset of Windows Information Protection.

For your data protection needs, Microsoft recommends that you use Microsoft Purview Information Protection and Microsoft Purview Data Loss Prevention. Purview simplifies the configuration set-up and provides an advanced set of capabilities.

Create an enterprise-protected file.

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

Parameters

parentFolder
IStorageFolder

The folder into which to create the enterprise protected file.

desiredName
String

Platform::String

winrt::hstring

The desired name of the new enterprise protected file.

identity
String

Platform::String

winrt::hstring

The enterprise identity. This is an email address or domain that is managed. Your app should use IsIdentityManaged to confirm that an email address or domain is managed.

collisionOption
CreationCollisionOption

A CreationCollisionOption value that specifies what to do if desiredName already exists.

Returns

When the call to this method completes successfully, it returns a ProtectedFileCreateResult object representing the newly created protected file.

Attributes

Windows requirements

App capabilities
enterpriseDataPolicy

Applies to

See also