forked from fifonik/FFBitrateViewer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgramInfo.cs
More file actions
32 lines (25 loc) · 1.13 KB
/
ProgramInfo.cs
File metadata and controls
32 lines (25 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
using System.Diagnostics;
using System.Globalization;
using System.Reflection;
namespace FFBitrateViewer
{
public static class ProgramInfo
{
public static string? Name { get; private set; }
public static string? Version { get; private set; }
public static FileVersionInfo? VersionInfo { get; private set; }
static ProgramInfo()
{
var assembly = Assembly.GetExecutingAssembly();
Name = assembly.GetName().Name;
var VersionInfo = FileVersionInfo.GetVersionInfo(assembly.Location);
Version = string.Format(CultureInfo.InvariantCulture, @"{0}.{1}", VersionInfo.ProductMajorPart, VersionInfo.ProductMinorPart);
if (VersionInfo.ProductBuildPart > 0) Version += "." + VersionInfo.ProductBuildPart.ToString(CultureInfo.InvariantCulture);
if (VersionInfo.ProductPrivatePart > 0)
{
Version += "b";
if (VersionInfo.ProductPrivatePart > 1) Version += VersionInfo.ProductPrivatePart.ToString(CultureInfo.InvariantCulture);
}
}
}
}