|
@@ -12,6 +12,7 @@ using System.Windows.Forms;
|
12
|
12
|
using System.IO;
|
13
|
13
|
using System.IO.Ports;
|
14
|
14
|
using System.Reflection;
|
|
15
|
+using System.Globalization;
|
15
|
16
|
|
16
|
17
|
namespace RF_TRIO_PLL_ZIG
|
17
|
18
|
{
|
|
@@ -28,10 +29,56 @@ namespace RF_TRIO_PLL_ZIG
|
28
|
29
|
InitializeComponent();
|
29
|
30
|
serial.Serial_Initialize(ref comboBox_Port);
|
30
|
31
|
System.Version assemblyVersion = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version;
|
31
|
|
- DateTime buildDate = new DateTime(2000, 1, 1).AddDays(assemblyVersion.Build).AddSeconds(assemblyVersion.Revision * 2);
|
32
|
|
- this.label_Build.Text = "Ver." + Assembly.GetExecutingAssembly().GetName().Version.ToString();
|
|
32
|
+ //DateTime buildDate = new DateTime(2000, 1, 1).AddDays(assemblyVersion.Build).AddSeconds(assemblyVersion.Revision * 2);
|
|
33
|
+ DateTime buildDate = getBuildDateTime();
|
|
34
|
+ this.label_Build.Text = buildDate.ToString("yyyy/MM/dd hh:mm:ss");
|
|
35
|
+ //this.label_Build.Text = "Ver." + Assembly.GetExecutingAssembly().GetName().Version.ToString();
|
|
36
|
+ }
|
|
37
|
+ /// <summary>
|
|
38
|
+ /// Version Text로부터 Build된 일시를 구합니다.
|
|
39
|
+ /// </summary>
|
|
40
|
+ /// <returns></returns>
|
|
41
|
+ /*public DateTime getBuildDateTime()
|
|
42
|
+ {
|
|
43
|
+ //1. Assembly.GetExecutingAssembly().FullName의 값은
|
|
44
|
+ //'ApplicationName, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'
|
|
45
|
+ //와 같다.
|
|
46
|
+ string strVersionText = Assembly.GetExecutingAssembly().FullName
|
|
47
|
+ .Split(',')[1]
|
|
48
|
+ .Trim()
|
|
49
|
+ .Split('=')[1];
|
|
50
|
+
|
|
51
|
+ //2. Version Text의 세번째 값(Build Number)은 2000년 1월 1일부터
|
|
52
|
+ //Build된 날짜까지의 총 일(Days) 수 이다.
|
|
53
|
+ int intDays = Convert.ToInt32(strVersionText.Split('.')[2]);
|
|
54
|
+ DateTime refDate = new DateTime(2000, 1, 1);
|
|
55
|
+ DateTime dtBuildDate = refDate.AddDays(intDays);
|
|
56
|
+
|
|
57
|
+ //3. Verion Text의 네번째 값(Revision NUmber)은 자정으로부터 Build된
|
|
58
|
+ //시간까지의 지나간 초(Second) 값 이다.
|
|
59
|
+ int intSeconds = Convert.ToInt32(strVersionText.Split('.')[3]);
|
|
60
|
+ intSeconds = intSeconds * 2;
|
|
61
|
+ dtBuildDate = dtBuildDate.AddSeconds(intSeconds);
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+ //4. 시차조정
|
|
65
|
+ DaylightTime daylingTime = TimeZone.CurrentTimeZone
|
|
66
|
+ .GetDaylightChanges(dtBuildDate.Year);
|
|
67
|
+ if (TimeZone.IsDaylightSavingTime(dtBuildDate, daylingTime))
|
|
68
|
+ dtBuildDate = dtBuildDate.Add(daylingTime.Delta);
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+ return dtBuildDate;
|
|
72
|
+ }*/
|
|
73
|
+ /// <summary>
|
|
74
|
+ /// Assembly의 Build된 일시를 구합니다.
|
|
75
|
+ /// </summary>
|
|
76
|
+ /// <returns></returns>
|
|
77
|
+ public DateTime getBuildDateTime()
|
|
78
|
+ {
|
|
79
|
+ Assembly assembly = Assembly.GetExecutingAssembly();
|
|
80
|
+ return System.IO.File.GetLastWriteTime(assembly.Location);
|
33
|
81
|
}
|
34
|
|
-
|
35
|
82
|
private void Firmware_Update_Click(object sender, EventArgs e)
|
36
|
83
|
{
|
37
|
84
|
OpenFileDialog ofd = new OpenFileDialog();
|