InstalledDesktopApp.GetInventoryAsync 方法

定义

获取可供当前用户使用的已安装 Win32 应用的列表。 这包括为所有用户以及仅为当前用户安装的应用。

public:
 static IAsyncOperation<IVectorView<InstalledDesktopApp ^> ^> ^ GetInventoryAsync();
/// [Windows.Foundation.Metadata.RemoteAsync]
 static IAsyncOperation<IVectorView<InstalledDesktopApp>> GetInventoryAsync();
[Windows.Foundation.Metadata.RemoteAsync]
public static IAsyncOperation<IReadOnlyList<InstalledDesktopApp>> GetInventoryAsync();
function getInventoryAsync()
Public Shared Function GetInventoryAsync () As IAsyncOperation(Of IReadOnlyList(Of InstalledDesktopApp))

返回

返回一个异步操作,指示任务已完成并包含当前用户可用的已安装 Win32 应用列表。

属性

示例

IReadOnlyList<InstalledDesktopApp> installedApps = await InstalledDesktopApp.GetInventoryAsync();

foreach (var app in installedApps)
{
    Console.WriteLine("Display Name: " + app.DisplayName);
    Console.WriteLine("Application ID: " + app.Id);
    Console.WriteLine("Publisher: " + app.Publisher);
    Console.WriteLine("Display Version: " + app.DisplayVersion);
}

注解

该列表包括为所有用户以及仅针对当前用户安装的应用。

适用于