共用方式為


InstallationManager.FindPackagesForCurrentPublisher 方法

定義

傳回與呼叫此方法的應用程式具有相同發行者識別碼的所有應用程式套件。

public:
 static IIterable<Package ^> ^ FindPackagesForCurrentPublisher();
 static IIterable<Package> FindPackagesForCurrentPublisher();
public static IEnumerable<Package> FindPackagesForCurrentPublisher();
function findPackagesForCurrentPublisher()
Public Shared Function FindPackagesForCurrentPublisher () As IEnumerable(Of Package)

傳回

與呼叫此方法的應用程式具有相同發行者識別碼的應用程式套件清單。

範例

using Windows.ApplicationModel;
using Windows.Phone.Management.Deployment;

void DisplayApplicationInfo(string ProductId)
{

    IEnumerable<Package> packages = InstallationManager.FindPackagesForCurrentPublisher();

    // Loop over all installed applications looking for the specified ProductId 
    // (not the most efficient way to search, but a simple way to show how to use   
    // the functionality. 
    foreach (Package package in packages)
    {
        if (package.Id.ProductId.ToString().ToLower()== ProductId.ToLower())
        {
            // Dislay the title info in the ApplicationTitle textlock.
            ApplicationTitle.Text = package.Id.Name;

            // Retrieve the icon image by getting its DSS Token.
            string token = package.GetThumbnailToken();

            // Do something with image token.

        }
    }
}

您也可以使用此方法來查看來自發行者識別碼的其他應用程式是否安裝在手機上。 如果已安裝它們,您可以啟動它們。 為了示範,下列範例會列舉目前發行者識別碼的所有應用程式,並啟動列舉 (中的第一個應用程式,除非該應用程式是目前的應用程式) 。

IEnumerable<Package> apps = Windows.Phone.Management.Deployment.InstallationManager.FindPackagesForCurrentPublisher();
apps.First().Launch(string.Empty);

備註

這個方法會傳回與呼叫應用程式發行者識別碼相關聯的所有應用程式。 這包括:

  • 手機上預先載入的應用程式。
  • 使用者安裝的應用程式。
  • 目前儲存在手機 SD 記憶卡上的應用程式。
  • 企業應用程式。

適用於