StoreContext.RequestUninstallStorePackageByStoreIdAsync(String) 方法

定義

嘗試卸載目前應用程式的指定可下載內容 (DLC) 套件。 這個方法也會顯示要求作業許可權的 UI 對話方塊。

public:
 virtual IAsyncOperation<StoreUninstallStorePackageResult ^> ^ RequestUninstallStorePackageByStoreIdAsync(Platform::String ^ storeId) = RequestUninstallStorePackageByStoreIdAsync;
/// [Windows.Foundation.Metadata.RemoteAsync]
IAsyncOperation<StoreUninstallStorePackageResult> RequestUninstallStorePackageByStoreIdAsync(winrt::hstring const& storeId);
[Windows.Foundation.Metadata.RemoteAsync]
public IAsyncOperation<StoreUninstallStorePackageResult> RequestUninstallStorePackageByStoreIdAsync(string storeId);
function requestUninstallStorePackageByStoreIdAsync(storeId)
Public Function RequestUninstallStorePackageByStoreIdAsync (storeId As String) As IAsyncOperation(Of StoreUninstallStorePackageResult)

參數

storeId
String

Platform::String

winrt::hstring

附加元件的市集識別碼,對應至要卸載目前應用程式的可下載內容 (DLC) 套件。

傳回

在成功完成時,非同步作業會傳回 StoreUninstallStorePackageResult 物件,該物件會提供卸載作業的相關資訊。

屬性

Windows 需求

裝置系列
Windows 10, version 1803 (已於 10.0.17134.0 引進)
API contract
Windows.Services.Store.StoreContract (已於 v3.0 引進)

備註

您可以使用這個方法來卸載不再需要的 DLC 套件來釋放磁碟空間。 例如,在使用者完成該行銷活動之後,提供單一玩家行銷活動和多人遊戲活動的遊戲可能會使用此方法來卸載使用者要求的單一玩家活動。

當您呼叫此方法時,OS 會顯示對話方塊,詢問使用者卸載應用程式套件的許可權。 若要以無訊息方式卸載應用程式套件而不顯示通知對話方塊,請使用 UninstallStorePackageAsyncUninstallStorePackageByStoreIdAsync (這些方法需要存取受限制的功能) 。

附加元件的市集識別碼可在合作夥伴中心取得,而且也會由代表附加元件的StoreProduct 的 StoreId屬性傳回。 如需詳細資訊,請參閱 存放區識別碼

注意

DLC 套件不適用於所有開發人員帳戶。

適用於

另請參閱