ソースを参照

Build 날짜 기능 추가

YJ 5 年 前
コミット
1b5efc1e92

+ 1 - 1
APL_TestCheck.csproj

@@ -11,7 +11,7 @@
11 11
     <TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
12 12
     <FileAlignment>512</FileAlignment>
13 13
     <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
14
-    <Deterministic>true</Deterministic>
14
+    <Deterministic>false</Deterministic>
15 15
   </PropertyGroup>
16 16
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
17 17
     <PlatformTarget>AnyCPU</PlatformTarget>

+ 41 - 28
Main.Designer.cs

@@ -32,6 +32,7 @@
32 32
             System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Main));
33 33
             this.serialPort = new System.IO.Ports.SerialPort(this.components);
34 34
             this.panel_Main = new System.Windows.Forms.Panel();
35
+            this.label_SerialWrite = new System.Windows.Forms.Label();
35 36
             this.button_Path = new System.Windows.Forms.Button();
36 37
             this.button_Clear = new System.Windows.Forms.Button();
37 38
             this.checkBox_Edit = new System.Windows.Forms.CheckBox();
@@ -63,8 +64,10 @@
63 64
             this.label_GPSTest = new System.Windows.Forms.Label();
64 65
             this.panel_SensorTest = new System.Windows.Forms.Panel();
65 66
             this.checkBox_Usim_Imei_Phone_Num = new System.Windows.Forms.CheckBox();
67
+            this.button_Write = new System.Windows.Forms.Button();
66 68
             this.button_Rewrite = new System.Windows.Forms.Button();
67 69
             this.textBox_PrevNum = new System.Windows.Forms.TextBox();
70
+            this.textBox_Write = new System.Windows.Forms.TextBox();
68 71
             this.textBox_AfterNum = new System.Windows.Forms.TextBox();
69 72
             this.button_SnRead = new System.Windows.Forms.Button();
70 73
             this.numericUpDown_ExcelOpenDelay = new System.Windows.Forms.NumericUpDown();
@@ -148,9 +151,7 @@
148 151
             this.dataGridViewTextBoxColumn3 = new System.Windows.Forms.DataGridViewTextBoxColumn();
149 152
             this.folderBrowserDialog_Mainpath = new System.Windows.Forms.FolderBrowserDialog();
150 153
             this.openFileDialog = new System.Windows.Forms.OpenFileDialog();
151
-            this.textBox_Write = new System.Windows.Forms.TextBox();
152
-            this.button_Write = new System.Windows.Forms.Button();
153
-            this.label_SerialWrite = new System.Windows.Forms.Label();
154
+            this.label_Version = new System.Windows.Forms.Label();
154 155
             this.panel_Main.SuspendLayout();
155 156
             this.panel4.SuspendLayout();
156 157
             ((System.ComponentModel.ISupportInitialize)(this.pictureBox5)).BeginInit();
@@ -208,6 +209,15 @@
208 209
             this.panel_Main.MouseMove += new System.Windows.Forms.MouseEventHandler(this.panel_Main_MouseMove);
209 210
             this.panel_Main.MouseUp += new System.Windows.Forms.MouseEventHandler(this.panel_Main_MouseUp);
210 211
             // 
212
+            // label_SerialWrite
213
+            // 
214
+            this.label_SerialWrite.AutoSize = true;
215
+            this.label_SerialWrite.Font = new System.Drawing.Font("굴림", 10F, System.Drawing.FontStyle.Bold);
216
+            this.label_SerialWrite.Location = new System.Drawing.Point(366, 17);
217
+            this.label_SerialWrite.Name = "label_SerialWrite";
218
+            this.label_SerialWrite.Size = new System.Drawing.Size(0, 14);
219
+            this.label_SerialWrite.TabIndex = 93;
220
+            // 
211 221
             // button_Path
212 222
             // 
213 223
             this.button_Path.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(159)))), ((int)(((byte)(200)))));
@@ -253,6 +263,7 @@
253 263
             // panel4
254 264
             // 
255 265
             this.panel4.BackColor = System.Drawing.Color.White;
266
+            this.panel4.Controls.Add(this.label_Version);
256 267
             this.panel4.Controls.Add(this.pictureBox5);
257 268
             this.panel4.Location = new System.Drawing.Point(-10, 642);
258 269
             this.panel4.Name = "panel4";
@@ -600,6 +611,17 @@
600 611
             this.checkBox_Usim_Imei_Phone_Num.Text = "USIM Default Number";
601 612
             this.checkBox_Usim_Imei_Phone_Num.UseVisualStyleBackColor = true;
602 613
             // 
614
+            // button_Write
615
+            // 
616
+            this.button_Write.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(159)))), ((int)(((byte)(200)))));
617
+            this.button_Write.Location = new System.Drawing.Point(402, 571);
618
+            this.button_Write.Name = "button_Write";
619
+            this.button_Write.Size = new System.Drawing.Size(75, 23);
620
+            this.button_Write.TabIndex = 98;
621
+            this.button_Write.Text = "Write";
622
+            this.button_Write.UseVisualStyleBackColor = false;
623
+            this.button_Write.Click += new System.EventHandler(this.button_Write_Click);
624
+            // 
603 625
             // button_Rewrite
604 626
             // 
605 627
             this.button_Rewrite.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(159)))), ((int)(((byte)(200)))));
@@ -618,6 +640,13 @@
618 640
             this.textBox_PrevNum.Size = new System.Drawing.Size(100, 21);
619 641
             this.textBox_PrevNum.TabIndex = 97;
620 642
             // 
643
+            // textBox_Write
644
+            // 
645
+            this.textBox_Write.Location = new System.Drawing.Point(316, 571);
646
+            this.textBox_Write.Name = "textBox_Write";
647
+            this.textBox_Write.Size = new System.Drawing.Size(80, 21);
648
+            this.textBox_Write.TabIndex = 97;
649
+            // 
621 650
             // textBox_AfterNum
622 651
             // 
623 652
             this.textBox_AfterNum.Location = new System.Drawing.Point(132, 571);
@@ -1366,32 +1395,14 @@
1366 1395
             // 
1367 1396
             this.openFileDialog.Multiselect = true;
1368 1397
             // 
1369
-            // textBox_Write
1398
+            // label_Version
1370 1399
             // 
1371
-            this.textBox_Write.Location = new System.Drawing.Point(316, 571);
1372
-            this.textBox_Write.Name = "textBox_Write";
1373
-            this.textBox_Write.Size = new System.Drawing.Size(80, 21);
1374
-            this.textBox_Write.TabIndex = 97;
1375
-            // 
1376
-            // button_Write
1377
-            // 
1378
-            this.button_Write.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(159)))), ((int)(((byte)(200)))));
1379
-            this.button_Write.Location = new System.Drawing.Point(402, 571);
1380
-            this.button_Write.Name = "button_Write";
1381
-            this.button_Write.Size = new System.Drawing.Size(75, 23);
1382
-            this.button_Write.TabIndex = 98;
1383
-            this.button_Write.Text = "Write";
1384
-            this.button_Write.UseVisualStyleBackColor = false;
1385
-            this.button_Write.Click += new System.EventHandler(this.button_Write_Click);
1386
-            // 
1387
-            // label_SerialWrite
1388
-            // 
1389
-            this.label_SerialWrite.AutoSize = true;
1390
-            this.label_SerialWrite.Font = new System.Drawing.Font("굴림", 10F, System.Drawing.FontStyle.Bold);
1391
-            this.label_SerialWrite.Location = new System.Drawing.Point(366, 17);
1392
-            this.label_SerialWrite.Name = "label_SerialWrite";
1393
-            this.label_SerialWrite.Size = new System.Drawing.Size(0, 14);
1394
-            this.label_SerialWrite.TabIndex = 93;
1400
+            this.label_Version.AutoSize = true;
1401
+            this.label_Version.Location = new System.Drawing.Point(20, 43);
1402
+            this.label_Version.Name = "label_Version";
1403
+            this.label_Version.Size = new System.Drawing.Size(38, 12);
1404
+            this.label_Version.TabIndex = 27;
1405
+            this.label_Version.Text = "label2";
1395 1406
             // 
1396 1407
             // Main
1397 1408
             // 
@@ -1407,6 +1418,7 @@
1407 1418
             this.panel_Main.ResumeLayout(false);
1408 1419
             this.panel_Main.PerformLayout();
1409 1420
             this.panel4.ResumeLayout(false);
1421
+            this.panel4.PerformLayout();
1410 1422
             ((System.ComponentModel.ISupportInitialize)(this.pictureBox5)).EndInit();
1411 1423
             this.panel1.ResumeLayout(false);
1412 1424
             this.panel1.PerformLayout();
@@ -1571,6 +1583,7 @@
1571 1583
         private System.Windows.Forms.Button button_Write;
1572 1584
         private System.Windows.Forms.TextBox textBox_Write;
1573 1585
         private System.Windows.Forms.Label label_SerialWrite;
1586
+        private System.Windows.Forms.Label label_Version;
1574 1587
     }
1575 1588
 }
1576 1589
 

+ 42 - 0
Main.cs

@@ -196,6 +196,9 @@ namespace APL_TestCheck
196 196
 
197 197
         private void Main_Load(object sender, EventArgs e)
198 198
         {
199
+
200
+            label_Version.Text = Get_BuildDateTime(System.Reflection.Assembly.GetExecutingAssembly().GetName().Version).ToString();
201
+
199 202
             Serial_Initialize(ref comboBox_Port);
200 203
             dataGridView_Gps.RowCount = 1;
201 204
             dataGridView_Catm1.RowCount = 1;
@@ -2979,5 +2982,44 @@ namespace APL_TestCheck
2979 2982
         {
2980 2983
             
2981 2984
         }
2985
+        /// <summary>
2986
+        /// 버전 정보를 넣으면 빌드 시간을 반환.
2987
+        /// </summary>
2988
+        /// <param name="version"></param>
2989
+        /// <returns></returns>
2990
+        public System.DateTime Get_BuildDateTime(System.Version version = null)
2991
+        {
2992
+            // 주.부.빌드.수정
2993
+            // 주 버전    Major Number
2994
+            // 부 버전    Minor Number
2995
+            // 빌드 번호  Build Number
2996
+            // 수정 버전  Revision NUmber
2997
+
2998
+            //매개 변수가 존재할 경우
2999
+            if (version == null)
3000
+                version = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version;
3001
+
3002
+            //세번째 값(Build Number)은 2000년 1월 1일부터
3003
+            //Build된 날짜까지의 총 일(Days) 수 이다.
3004
+            int day = version.Build;
3005
+            System.DateTime dtBuild = (new System.DateTime(2000, 1, 1)).AddDays(day);
3006
+
3007
+            //네번째 값(Revision NUmber)은 자정으로부터 Build된
3008
+            //시간까지의 지나간 초(Second) 값 이다.
3009
+            int intSeconds = version.Revision;
3010
+            intSeconds = intSeconds * 2;
3011
+            dtBuild = dtBuild.AddSeconds(intSeconds);
3012
+
3013
+
3014
+            //시차 보정
3015
+            System.Globalization.DaylightTime daylingTime = System.TimeZone.CurrentTimeZone
3016
+                    .GetDaylightChanges(dtBuild.Year);
3017
+            if (System.TimeZone.IsDaylightSavingTime(dtBuild, daylingTime))
3018
+                dtBuild = dtBuild.Add(daylingTime.Delta);
3019
+
3020
+            return dtBuild;
3021
+        }
3022
+
3023
+
2982 3024
     }
2983 3025
 }

+ 7 - 3
Properties/AssemblyInfo.cs

@@ -31,6 +31,10 @@ using System.Runtime.InteropServices;
31 31
 //
32 32
 // 모든 값을 지정하거나 아래와 같이 '*'를 사용하여 빌드 번호 및 수정 번호가 자동으로
33 33
 // 지정되도록 할 수 있습니다.
34
-// [assembly: AssemblyVersion("1.0.*")]
35
-[assembly: AssemblyVersion("1.0.0.0")]
36
-[assembly: AssemblyFileVersion("1.0.0.0")]
34
+[assembly: AssemblyVersion("1.0.*")]
35
+//[assembly: AssemblyVersion("1.0.0.0")]
36
+//[assembly: AssemblyFileVersion("1.0.0.0")]
37
+
38
+
39
+
40
+

BIN
bin/Debug/APL_TestCheck.exe


BIN
bin/Debug/APL_TestCheck.pdb


BIN
bin/Release/APL_TestCheck.exe


BIN
bin/Release/APL_TestCheck.pdb


BIN
obj/Debug/APL_TestCheck.csproj.GenerateResource.cache


BIN
obj/Debug/APL_TestCheck.exe


BIN
obj/Debug/APL_TestCheck.pdb


+ 1 - 0
obj/Release/APL_TestCheck.csproj.FileListAbsolute.txt

@@ -13,3 +13,4 @@ D:\C#\APL_TestCheck\APL_TestCheck\obj\Release\APL_TestCheck.csproj.CoreCompileIn
13 13
 D:\C#\APL_TestCheck\APL_TestCheck\obj\Release\APL_TestCheck.csproj.CopyComplete
14 14
 D:\C#\APL_TestCheck\APL_TestCheck\obj\Release\APL_TestCheck.exe
15 15
 D:\C#\APL_TestCheck\APL_TestCheck\obj\Release\APL_TestCheck.pdb
16
+D:\C#\APL_TestCheck\APL_TestCheck\obj\Release\APL_TestCheck.csprojAssemblyReference.cache

BIN
obj/Release/APL_TestCheck.csproj.GenerateResource.cache


BIN
obj/Release/APL_TestCheck.csprojAssemblyReference.cache


BIN
obj/Release/APL_TestCheck.exe


BIN
obj/Release/APL_TestCheck.pdb