Commit 451bd5fb 几米阳光

增加版本号

1 个父辈 6c74bd48
...@@ -13,6 +13,33 @@ namespace OnlineStore.ACSingleStore ...@@ -13,6 +13,33 @@ namespace OnlineStore.ACSingleStore
{ {
public partial class FrmBase : Form public partial class FrmBase : Form
{ {
public static string GetVersion()
{
string str = "";
string version = "";
DateTime newData = DateTime.Parse("2000-01-01");
try
{
version = System.Reflection.Assembly.GetExecutingAssembly().GetName().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:ss");
}
}
catch (Exception ex)
{
str = version;
LogUtil.error("解析版本号【" + str + "】出错:" + ex.ToString());
}
LogUtil.info("版本号[" + version + "][" + str + "]");
return str;
}
public FrmBase() public FrmBase()
{ {
InitializeComponent(); InitializeComponent();
......
...@@ -146,8 +146,11 @@ namespace OnlineStore.ACSingleStore ...@@ -146,8 +146,11 @@ namespace OnlineStore.ACSingleStore
} }
private bool LoadOk = false; private bool LoadOk = false;
private void FrmTest_Load(object sender, EventArgs e) private void FrmTest_Load(object sender, EventArgs e)
{ {
string version = GetVersion();
LogUtil.logBox = this.richTextBox1; LogUtil.logBox = this.richTextBox1;
initValue(); initValue();
this.ShowInTaskbar = true; this.ShowInTaskbar = true;
......
...@@ -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!