ApplicationData.SetVersionAsync 方法

定義

設定應用程式資料存放區中應用程式資料的版本號碼。

public:
 virtual IAsyncAction ^ SetVersionAsync(unsigned int desiredVersion, ApplicationDataSetVersionHandler ^ handler) = SetVersionAsync;
/// [Windows.Foundation.Metadata.RemoteAsync]
IAsyncAction SetVersionAsync(uint32_t const& desiredVersion, ApplicationDataSetVersionHandler const& handler);
[Windows.Foundation.Metadata.RemoteAsync]
public IAsyncAction SetVersionAsync(uint desiredVersion, ApplicationDataSetVersionHandler handler);
function setVersionAsync(desiredVersion, handler)
Public Function SetVersionAsync (desiredVersion As UInteger, handler As ApplicationDataSetVersionHandler) As IAsyncAction

參數

desiredVersion
UInt32

unsigned int

uint32_t

新的版本號碼。

handler
ApplicationDataSetVersionHandler

設定版本事件處理常式。

傳回

物件,用來管理非同步集合版本作業。

屬性

備註

版本設定可讓您變更應用程式未來版本中使用的應用程式資料格式,而不會造成繼承應用程式的相容性問題。 應用程式會檢查資料存放區中的資料版本,如果它小於應用程式預期的版本,應用程式應該將應用程式資料更新為新的格式並更新版本。

強烈建議您從 1 開始使用循序和遞增的版本號碼。

適用於