Get Assembly version on windows phone 7

前端 未结 4 657
北恋
北恋 2021-02-13 23:56

In my c# applications I usually get the version (to show the customer) using the following code:

System.Reflection.Assembly.GetExecutingAssembly().GetName().Vers         


        
4条回答
  •  眼角桃花
    2021-02-14 00:45

     public static string GetVersion()
        {
            return Regex.Match(Assembly.GetExecutingAssembly().FullName, @"Version=(?[\d\.]*)").Groups["version"].Value;
        }
    

    is fairly clean as well.

提交回复
热议问题