Share via


ProtectionPolicyManager.IsFileProtectionRequiredAsync 方法

定义

注意

从 2022 年 7 月开始,Microsoft 将弃用 Windows 信息保护 (WIP) 和支持 WIP 的 API。 Microsoft 将继续在受支持的 Windows 版本上支持 WIP。 新版本的 Windows 不包括 WIP 的新功能,并且将来的 Windows 版本将不受支持。 有关详细信息,请参阅宣布 Windows 信息保护停用

对于数据保护需求,Microsoft 建议使用Microsoft Purview 信息保护Microsoft Purview 数据丢失防护。 Purview 简化了配置设置,并提供一组高级功能。

指示文件是否需要受企业标识的保护。

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

参数

target
IStorageItem

要知道是否要保护的文件。

identity
String

Platform::String

winrt::hstring

企业标识。

返回

如果文件应受保护,则为 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 中引入)

注解

代码可以调用此方法,以避免加密不需要加密的文件,例如 exe、dll 和其他生成项目。 这降低了计算机其他用户无法访问这些文件的风险,并降低了不必要地加密文件的性能成本。

适用于