54 lines
1.1 KiB
C#
54 lines
1.1 KiB
C#
using MAX.Framework.Helpers;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Diagnostics;
|
|
using System.Linq;
|
|
using System.Reflection;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace Store.Framework;
|
|
|
|
public static class Config
|
|
{
|
|
public const string AppVersion = "1312";
|
|
|
|
public static bool IsRelease
|
|
{
|
|
get
|
|
{
|
|
#if RELEASE
|
|
return true;
|
|
#else
|
|
return false;
|
|
#endif
|
|
}
|
|
}
|
|
|
|
public static Guid SessionID { get; }
|
|
public static DateTime AppStartTime { get; }
|
|
public static string Version => AppVersion;
|
|
static Config()
|
|
{
|
|
SessionID = Guid.NewGuid();
|
|
AppStartTime = DateTime.Now;
|
|
|
|
//FileVersionInfo info = FileVersionInfo.GetVersionInfo(Assembly.GetEntryAssembly().Location);
|
|
//Version = new VersionStruct(info.FileMajorPart, info.ProductMinorPart, info.FileBuildPart, info.FilePrivatePart);
|
|
|
|
}
|
|
public static string GetFullVersionString()
|
|
{
|
|
static IEnumerable<string> GetStrings()
|
|
{
|
|
yield return Version.ToString();
|
|
yield return IsRelease ? "Release" : "Debug";
|
|
if (SystemHelper.IsAdministratorSafe)
|
|
{
|
|
yield return "管理员权限";
|
|
}
|
|
}
|
|
return string.Join(" - ", GetStrings());
|
|
}
|
|
}
|