diff --git a/Projects/NetStandard/KmsProxy.GUI/Form1.Designer.cs b/Projects/NetStandard/KmsProxy.GUI/Form1.Designer.cs index da9c18a..1e338ac 100644 --- a/Projects/NetStandard/KmsProxy.GUI/Form1.Designer.cs +++ b/Projects/NetStandard/KmsProxy.GUI/Form1.Designer.cs @@ -115,6 +115,8 @@ this.richTextBox21 = new System.Windows.Forms.RichTextBox(); this.button11 = new System.Windows.Forms.Button(); this.richTextBox22 = new System.Windows.Forms.RichTextBox(); + this.textBox1 = new System.Windows.Forms.TextBox(); + this.label36 = new System.Windows.Forms.Label(); this.panel1.SuspendLayout(); this.tabControl1.SuspendLayout(); this.tabPage1.SuspendLayout(); @@ -136,6 +138,8 @@ // // panel1 // + this.panel1.Controls.Add(this.label36); + this.panel1.Controls.Add(this.textBox1); this.panel1.Controls.Add(this.textPort); this.panel1.Controls.Add(this.label4); this.panel1.Controls.Add(this.textHost); @@ -992,6 +996,23 @@ this.richTextBox22.TabIndex = 0; this.richTextBox22.Text = ""; // + // textBox1 + // + this.textBox1.Location = new System.Drawing.Point(590, 19); + this.textBox1.Name = "textBox1"; + this.textBox1.Size = new System.Drawing.Size(399, 21); + this.textBox1.TabIndex = 4; + this.textBox1.Text = "333735413051493048424d55000300010000000000000000000000"; + // + // label36 + // + this.label36.AutoSize = true; + this.label36.Location = new System.Drawing.Point(492, 24); + this.label36.Name = "label36"; + this.label36.Size = new System.Drawing.Size(92, 12); + this.label36.TabIndex = 5; + this.label36.Text = "Example EcuID"; + // // Form1 // this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F); @@ -1123,6 +1144,8 @@ private System.Windows.Forms.RichTextBox richTextBox21; private System.Windows.Forms.Button button11; private System.Windows.Forms.RichTextBox richTextBox22; + private System.Windows.Forms.Label label36; + private System.Windows.Forms.TextBox textBox1; } } diff --git a/Projects/NetStandard/KmsProxy/Models/Packet.cs b/Projects/NetStandard/KmsProxy/Models/Packet.cs index 0f54de0..fc4d104 100644 --- a/Projects/NetStandard/KmsProxy/Models/Packet.cs +++ b/Projects/NetStandard/KmsProxy/Models/Packet.cs @@ -9,9 +9,9 @@ namespace KmsProxy.Models { public class Request_SupplierEcuID { - public string EcuType { get; set; } = string.Empty; - public string Phase { get; set; } = string.Empty; - public string SupplierID { get; set; } = string.Empty; + public string EcuType { get; set; } = "01"; + public string Phase { get; set; } = "Dev"; + public string SupplierID { get; set; } = "03"; public string EcuID { get; set; } = string.Empty; public string Serial { get; set; } = string.Empty; } @@ -26,7 +26,7 @@ namespace KmsProxy.Models { public class Request_SupplierKeyProvisioning { - public string ProvisioningType { get; set; } = string.Empty; + public string ProvisioningType { get; set; } = "EcuMasterKey"; public string EcuID { get; set; } = string.Empty; public string KeyID { get; set; } = string.Empty; } @@ -50,7 +50,7 @@ namespace KmsProxy.Models // public class Request_SupplierKeyProvisioning_Result { - public string ProvisioningType { get; set; } = string.Empty; + public string ProvisioningType { get; set; } = "SupplierSymmKey"; public string EcuID { get; set; } = string.Empty; public string ResultMessage { get; set; } = string.Empty; public string ResultStatus { get; set; } = string.Empty; @@ -65,7 +65,7 @@ namespace KmsProxy.Models { public class Request_SupplierKeyProvisioning { - public string ProvisioningType { get; set; } = string.Empty; + public string ProvisioningType { get; set; } = "SupplierSymmKey"; public string EcuID { get; set; } = string.Empty; public string KeyID { get; set; } = string.Empty; } @@ -88,7 +88,7 @@ namespace KmsProxy.Models // public class Request_SupplierKeyProvisioning_Result { - public string ProvisioningType { get; set; } = string.Empty; + public string ProvisioningType { get; set; } = "SupplierSymmKey"; public string EcuID { get; set; } = string.Empty; public string ResultMessage { get; set; } = string.Empty; public string ResultStatus { get; set; } = string.Empty; @@ -100,7 +100,7 @@ namespace KmsProxy.Models // public class Request_SupplierKeySyncValue { - public string ProvisioningType { get; set; } = string.Empty; + public string ProvisioningType { get; set; } = "SupplierSymmKey"; public string EcuID { get; set; } = string.Empty; public string KeyID { get; set; } = string.Empty; } @@ -121,7 +121,7 @@ namespace KmsProxy.Models // public class Request_SupplierKeySyncValue_Result { - public string ProvisioningType { get; set; } = string.Empty; + public string ProvisioningType { get; set; } = "SupplierSymmKey"; public string EcuID { get; set; } = string.Empty; public string ResultMessage { get; set; } = string.Empty; public string ResultStatus { get; set; } = string.Empty; @@ -136,7 +136,7 @@ namespace KmsProxy.Models { public class Request_SupplierKeyProvisioning { - public string ProvisioningType { get; set; } = string.Empty; + public string ProvisioningType { get; set; } = "SecOCKey"; public string EcuID { get; set; } = string.Empty; public string KeyID { get; set; } = string.Empty; public string SupplierSecretKey { get; set; } = string.Empty; @@ -163,7 +163,7 @@ namespace KmsProxy.Models // public class Request_SupplierKeyProvisioning_Result { - public string ProvisioningType { get; set; } = string.Empty; + public string ProvisioningType { get; set; } = "SecOCKey"; public string EcuID { get; set; } = string.Empty; public string KeyID { get; set; } = string.Empty; public string ResultMessage { get; set; } = string.Empty; @@ -176,7 +176,7 @@ namespace KmsProxy.Models // public class Request_SupplierKeySyncValue { - public string ProvisioningType { get; set; } = string.Empty; + public string ProvisioningType { get; set; } = "SecOCKey"; public string EcuID { get; set; } = string.Empty; public string KeyID { get; set; } = string.Empty; } @@ -197,7 +197,7 @@ namespace KmsProxy.Models // public class Request_SupplierKeySyncValue_Result { - public string ProvisioningType { get; set; } = string.Empty; + public string ProvisioningType { get; set; } = "SecOCKey"; public string EcuID { get; set; } = string.Empty; public string KeyID { get; set; } = string.Empty; public string ResultMessage { get; set; } = string.Empty; diff --git a/Projects/NetStandard/PlayGround.NetFramework/Program.cs b/Projects/NetStandard/PlayGround.NetFramework/Program.cs index b5028a9..224c9e7 100644 --- a/Projects/NetStandard/PlayGround.NetFramework/Program.cs +++ b/Projects/NetStandard/PlayGround.NetFramework/Program.cs @@ -6,44 +6,56 @@ using System.Globalization; using System.Threading.Tasks; namespace PlayGround.NetFramework -{ - public static class Date - { - public static string ToKst24String(DateTimeOffset dateTime) - { - var kstZone = TimeZoneInfo.FindSystemTimeZoneById("Korea Standard Time"); - var kst = TimeZoneInfo.ConvertTime(dateTime, kstZone); - - return kst.ToString("yyyy-MM-dd HH:mm:ss", CultureInfo.InvariantCulture); - } - } +{ internal class Program { + public static string SetConvertDateTime(string strGetConvertText) + { + //입력문자열이 DateTime으로 변환 가능한 표준일때. + if(DateTime.TryParse(strGetConvertText, out var convertDate) == true) + { + Console.WriteLine("[SetConvertDateTime] Convert DateTime Format Success."); + return convertDate.ToString("yyyy-MM-dd HH:mm:ss", CultureInfo.InvariantCulture); + } + + //입력문자열이 DateTime 표준이 아닐때 그대로 리턴. + Console.WriteLine("[SetConvertDateTime] Convert DateTime Format Failed."); + return strGetConvertText; + } + + public static string SetConvertDateTime(DateTime dateTime) + { + return(SetConvertDateTime(dateTime.ToString())); + } + static void Main(string[] args) { - // 각 국가 TimeZone 가져오기 - var indiaZone = TimeZoneInfo.FindSystemTimeZoneById("India Standard Time"); - var vietnamZone = TimeZoneInfo.FindSystemTimeZoneById("SE Asia Standard Time"); - var usaEasternZone = TimeZoneInfo.FindSystemTimeZoneById("Eastern Standard Time"); - var kstZone = TimeZoneInfo.FindSystemTimeZoneById("Korea Standard Time"); + //string input + DateTime now = DateTime.Now; + string convertDate = SetConvertDateTime(now.ToString()); + Console.WriteLine($"DateTime.Now: {now}"); + Console.WriteLine($"DateTime.Now.Convert: {convertDate}"); + Console.WriteLine(""); - // 각 국가 현재 시간 생성 - DateTimeOffset indiaNow = TimeZoneInfo.ConvertTime(DateTimeOffset.UtcNow, indiaZone); - DateTimeOffset vietnamNow = TimeZoneInfo.ConvertTime(DateTimeOffset.UtcNow, vietnamZone); - DateTimeOffset usaNow = TimeZoneInfo.ConvertTime(DateTimeOffset.UtcNow, usaEasternZone); + string now2 = DateTime.Now.ToString("HH:mm:ss MM-dd-yyyy"); + string convertDate2 = SetConvertDateTime(now2); + Console.WriteLine($"DateTime.Now2: {now2}"); + Console.WriteLine($"DateTime.Now.Convert2: {convertDate2}"); + Console.WriteLine(""); - Console.WriteLine("=== 원본 시간 ==="); - Console.WriteLine($"India : {indiaNow:yyyy-MM-dd HH:mm:ss}"); - Console.WriteLine($"Vietnam : {vietnamNow:yyyy-MM-dd HH:mm:ss}"); - Console.WriteLine($"USA(ET) : {usaNow:yyyy-MM-dd HH:mm:ss}"); + string now3 = "3/3/2026 1:29:43 PM"; + string convertDate3 = SetConvertDateTime(now3); + Console.WriteLine($"DateTime.Now3: {now3}"); + Console.WriteLine($"DateTime.Now.Convert3: {convertDate3}"); + Console.WriteLine(""); - Console.WriteLine(); - Console.WriteLine("=== KST 변환 ==="); - - Console.WriteLine($"India → KST : {Date.ToKst24String(indiaNow)}"); - Console.WriteLine($"Vietnam → KST : {Date.ToKst24String(vietnamNow)}"); - Console.WriteLine($"USA → KST : {Date.ToKst24String(usaNow)}"); + //datetime input + var now4 = DateTime.Now; + string convertDate4 = SetConvertDateTime(now4); + Console.WriteLine($"DateTime.Now4: {now4}"); + Console.WriteLine($"DateTime.Now.Convert4: {convertDate4}"); + Console.WriteLine(""); return;