How to get app version in Windows Phone?

后端 未结 11 2159
無奈伤痛
無奈伤痛 2020-12-01 13:55

In C# one can use System.Version.Assembly to get the version of a running app. However this doesn\'t appear to exist in Silverlight for Windows Phone. Is there an alternat

11条回答
  •  醉酒成梦
    2020-12-01 14:33

    System.Text.RegularExpressions.Regex regexVersion = new System.Text.RegularExpressions.Regex(@".*(?\d+.\d+.\d+.\d+).*");
    System.Text.RegularExpressions.Match regexVersion_Match = regexVersion.Match(System.Reflection.Assembly.GetExecutingAssembly().FullName);
    string appVersion = "";
    if (regexVersion_Match.Success)
        appVersion = regexVersion_Match.Groups["v"].Value;
    

提交回复
热议问题