Commit 6403612b LN

1

1 个父辈 5c320d1a
...@@ -24,6 +24,8 @@ namespace SmartShelf ...@@ -24,6 +24,8 @@ namespace SmartShelf
private List<TabPage> tabPageList = new List<TabPage>(); private List<TabPage> tabPageList = new List<TabPage>();
private void FrmSmartShelf_Load(object sender, EventArgs e) private void FrmSmartShelf_Load(object sender, EventArgs e)
{ {
GetVersion();
chbAuto.Checked = ConfigAppSettings.GetIntValue(Setting_Init.App_AutoRun).Equals(1); chbAuto.Checked = ConfigAppSettings.GetIntValue(Setting_Init.App_AutoRun).Equals(1);
LogUtil.showCount = 200; LogUtil.showCount = 200;
string title = ConfigAppSettings.GetValue(Setting_Init.App_Title); string title = ConfigAppSettings.GetValue(Setting_Init.App_Title);
...@@ -37,6 +39,44 @@ namespace SmartShelf ...@@ -37,6 +39,44 @@ namespace SmartShelf
LoadStoreData(); LoadStoreData();
LoadOk = true; LoadOk = true;
} }
internal static string GetVersion(bool IsShow = false)
{
string str = "";
string version = "";
DateTime newData = DateTime.Parse("2000-01-01");
try
{
System.Reflection.AssemblyName assemblyName = System.Reflection.Assembly.GetExecutingAssembly().GetName();
version = assemblyName.Version.ToString();
string[] strArray = version.Split('.');
if (strArray.Length.Equals(4))
{
int days = Convert.ToInt32(strArray[2]);
int seconds = Convert.ToInt32(strArray[3]);
DateTime d1 = DateTime.Parse("2000-01-01");
newData = d1.AddDays(days);
newData = newData.AddSeconds(seconds * 2);
str = newData.ToString("yyyy-MM-dd HH:mm");
}
}
catch (Exception ex)
{
str = version;
LogUtil.error("解析版本号【" + str + "】出错:" + ex.ToString());
}
if (IsShow)
{
LogUtil.info("版本号[" + version + "][" + str + "][" + GetCodeNum() + "]");
}
return str;
}
internal static string GetCodeNum(string codeName = "SmartShelf")
{
byte[] byteArray = System.Text.Encoding.ASCII.GetBytes(codeName);
string result = "";
result = AcSerialBean.ByteToString(byteArray);
return result;
}
private void LoadStoreData() private void LoadStoreData()
{ {
......
...@@ -31,6 +31,6 @@ using System.Runtime.InteropServices; ...@@ -31,6 +31,6 @@ using System.Runtime.InteropServices;
// //
// 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值, // 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
// 方法是按如下所示使用“*”: // 方法是按如下所示使用“*”:
// [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")] //[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")] //[assembly: AssemblyFileVersion("1.0.0.0")]
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!