InstallationManager.AddPackageAsync 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
AddPackageAsync(String, Uri) |
启动由应用标题和位置 URI 指定的应用的安装过程。 |
AddPackageAsync(String, Uri, String, String, Uri) |
此 API 不应在代码中直接使用。 |
AddPackageAsync(String, Uri)
启动由应用标题和位置 URI 指定的应用的安装过程。
public:
static IAsyncOperationWithProgress<PackageInstallResult ^, unsigned int> ^ AddPackageAsync(Platform::String ^ title, Uri ^ sourceLocation);
/// [Windows.Foundation.Metadata.Overload("AddPackageAsync")]
static IAsyncOperationWithProgress<PackageInstallResult, uint32_t> AddPackageAsync(winrt::hstring const& title, Uri const& sourceLocation);
[Windows.Foundation.Metadata.Overload("AddPackageAsync")]
public static IAsyncOperationWithProgress<PackageInstallResult,uint> AddPackageAsync(string title, System.Uri sourceLocation);
function addPackageAsync(title, sourceLocation)
Public Shared Function AddPackageAsync (title As String, sourceLocation As Uri) As IAsyncOperationWithProgress(Of PackageInstallResult, UInteger)
参数
- title
-
String
Platform::String
winrt::hstring
要安装的应用的名称。
返回
Windows.Foundation.IAsyncOperationWithProgress<Windows.Phone.Management.Deployment.PackageInstallResult,unsigned int>
表示安装过程的异步操作。
- 属性
示例
void InstallMyCoolApp()
{
Uri uri = new Uri(@"https://PlaceHolderServerName/XAP/MyCoolApp.xap");
string appTitle = "Cool App";
Windows.Foundation.IAsyncOperationWithProgress<PackageInstallResult, uint> result;
// Queue up an installation request.
result = InstallationManager.AddPackageAsync(appTitle, uri);
// Note: You could save "result" as a member variable to enable
// the installation to be cancelled later.
}
另请参阅
适用于
AddPackageAsync(String, Uri, String, String, Uri)
此 API 不应在代码中直接使用。
public:
static IAsyncOperationWithProgress<PackageInstallResult ^, unsigned int> ^ AddPackageAsync(Platform::String ^ title, Uri ^ sourceLocation, Platform::String ^ instanceId, Platform::String ^ offerId, Uri ^ license);
/// [Windows.Foundation.Metadata.Overload("AddPackagePreloadedAsync")]
static IAsyncOperationWithProgress<PackageInstallResult, uint32_t> AddPackageAsync(winrt::hstring const& title, Uri const& sourceLocation, winrt::hstring const& instanceId, winrt::hstring const& offerId, Uri const& license);
[Windows.Foundation.Metadata.Overload("AddPackagePreloadedAsync")]
public static IAsyncOperationWithProgress<PackageInstallResult,uint> AddPackageAsync(string title, System.Uri sourceLocation, string instanceId, string offerId, System.Uri license);
function addPackageAsync(title, sourceLocation, instanceId, offerId, license)
Public Shared Function AddPackageAsync (title As String, sourceLocation As Uri, instanceId As String, offerId As String, license As Uri) As IAsyncOperationWithProgress(Of PackageInstallResult, UInteger)
参数
- title
-
String
Platform::String
winrt::hstring
此 API 不应在代码中直接使用。
- instanceId
-
String
Platform::String
winrt::hstring
此 API 不应在代码中直接使用。
- offerId
-
String
Platform::String
winrt::hstring
此 API 不应在代码中直接使用。
返回
Windows.Foundation.IAsyncOperationWithProgress<Windows.Phone.Management.Deployment.PackageInstallResult,unsigned int>
此 API 不应在代码中直接使用。
- 属性
Windows 要求
应用功能 |
oemDeployment
|