FileProtectionManager.CreateProtectedAndOpenAsync 方法

定義

注意

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

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

建立受企業保護的檔案。

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)

參數

parentFolder
IStorageFolder

要在其中建立企業受保護檔案的資料夾。

desiredName
String

Platform::String

winrt::hstring

新企業受保護檔案所需的名稱。

identity
String

Platform::String

winrt::hstring

企業身分識別。 這是受管理的電子郵件地址或網域。 您的應用程式應該使用 IsIdentityManaged 來確認電子郵件地址或網域受到管理。

collisionOption
CreationCollisionOption

CreationCollisionOption值,指定desiredName已經存在時要執行的動作。

傳回

當呼叫這個方法成功完成時,它會傳回 ProtectedFileCreateResult 物件,代表新建立的受保護檔案。

屬性

Windows 需求

應用程式功能
enterpriseDataPolicy

適用於

另請參閱