简体   繁体   English

如何在Windows Phone 8中检查应用程序是否已更新或全新安装?

[英]How to check if app is updated or fresh install in Windows Phone 8?

我正在Windows Phone 8中开发应用程序。是否可以通过某些应用程序数据确定该设备上是全新安装还是已更新的应用程序?

string currentAppVer = string.Empty;
var xmlReaderSettings = new XmlReaderSettings { XmlResolver = new XmlXapResolver() };
using (var xmlReader = XmlReader.Create("WMAppManifest.xml", xmlReaderSettings))
{
     xmlReader.ReadToDescendant("App");
     currentAppVer = xmlReader.GetAttribute("Version").Replace(".", "");
}

try
{
     if ((Convert.ToInt32(currentAppVer)) < (Convert.ToInt32(response.appVersion)))
     {
          MarketplaceDetailTask marketplaceDetailTask = new MarketplaceDetailTask();
          marketplaceDetailTask.ContentIdentifier = App.appContentIdentifier;
          marketplaceDetailTask.ContentType = MarketplaceContentType.Applications;
          marketplaceDetailTask.Show();
          Application.Current.Terminate();
     }
}
catch (Exception ex)
{ }

Where response.appVersion is the Application Version that you can maintain in IsolatedStorageSettings OR in Database... 其中response.appVersion是可以在IsolatedStorageSettings或数据库中维护的应用程序版本...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在设备中安装我的Windows Phone 7应用程序 - how to install my windows phone 7 app in device 全新Windows 10安装-IIS 10-现有MVC应用程序无法正常运行 - Fresh Windows 10 Install - IIS 10 - Existing MVC App not working 如何以最简单的方式在其他手机中安装Windows Phone 8.1应用程序? - How to install Windows Phone 8.1 app in other phones in the simplest way? 如何检查Windows Phone应用程序的更新是否可用? - How do I check if update for my Windows Phone App is available? 如何检查应用程序是否已从Windows Phone市场预先加载或安装 - How to check if the app is preloaded or installed from Windows Phone marketplace 仅在Windows Phone 8.1中安装应用 - install app only in windows phone 8.1 检查Windows 8手机应用程序中是否打开了GPS和Internet? - Check if GPS and Internet is turned on in windows 8 phone app? 检查Windows 8手机应用程序中的Internet是否已打开? - Check if Internet is turned on in windows 8 phone app? Windows Phone应用程序更新到.NET 4.5和MvvmCross 3.5.1导致崩溃 - Windows Phone app updated to .NET 4.5 and MvvmCross 3.5.1 causes crash Windows Phone 8 App出现“您需要为此任务安装应用程序”错误 - “You need to install an app for this task” error with Windows Phone 8 App
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM