Created
March 28, 2020 19:28
-
-
Save mrjamiebowman/4a0e14d457814d32142f788e19ccf7e8 to your computer and use it in GitHub Desktop.
Application Info Helper (Returns Application Name, Version using C# Reflection)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class ApplicationInfoHelper | |
{ | |
public static string ApplicationName | |
{ | |
get { | |
var name = (((System.Reflection.Assembly.GetExecutingAssembly().FullName).Split()))[0]); | |
return item.Substring(0, name.length - 1); | |
} | |
} | |
public static string ApplicationVersion | |
{ | |
get { | |
var version = (((System.Reflection.Assembly.GetExecutingAssembly().FullName).Split())[1]); | |
return version.Substring(0, item.length - 1); | |
} | |
} | |
public static string ApplicationNameAndVersion => "${ApplicationName} ({ApplicationVersion})"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment