main
syneffort 2 years ago
parent bce6521e43
commit a3a0cc201b
  1. 71
      MySolution/ConsoleApp/TelnetSamples/AsyncSocketTelnetClient.cs
  2. 5
      MySolution/ConsoleApp/TelnetSamples/AsyncStreamTelnetClient.cs
  3. 20
      MySolution/ConsoleApp/TelnetSamples/AsyncTelnetConsole.cs
  4. 1
      MySolution/ConsoleApp/TelnetSamples/IAsyncTelnetClient.cs
  5. 10
      MySolution/ConsoleApp/TelnetSamples/TelnetConsole.cs
  6. 388
      MySolution/SerialComApp/SerialCommApp.Designer.cs
  7. 28
      MySolution/SerialComApp/SerialCommApp.resx

@ -12,17 +12,18 @@ namespace ConsoleApp.TelnetSamples
{ {
internal class AsyncSocketTelnetClient : IAsyncTelnetClient internal class AsyncSocketTelnetClient : IAsyncTelnetClient
{ {
private readonly CancellationTokenSource CTS = new CancellationTokenSource(); private CancellationTokenSource _cts;
public event EventHandler<string> MessageCallback; public event EventHandler<string> MessageCallback;
public event EventHandler<Exception> ErrorCallback;
private Socket _socket; private Socket _socket;
public async void Connect(string ip, int port = 23) public async void Connect(string ip, int port = 23)
{ {
try try
{ {
Close(); //Close();
_socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); _socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
_socket.ReceiveTimeout = 1000; _socket.ReceiveTimeout = 1000;
@ -31,28 +32,37 @@ namespace ConsoleApp.TelnetSamples
IPEndPoint iPEndPoint = new IPEndPoint(ipAddress, port); IPEndPoint iPEndPoint = new IPEndPoint(ipAddress, port);
await _socket.ConnectAsync(iPEndPoint); await _socket.ConnectAsync(iPEndPoint);
Task.Run(ReadAsync); _cts = new CancellationTokenSource();
Task.Run(ReadAsync, _cts.Token);
} }
catch (Exception) catch (Exception ex)
{ {
throw; if (this.ErrorCallback != null)
} this.ErrorCallback(this, ex);
}
} }
private async void ReadAsync() private async void ReadAsync()
{ {
try try
{ {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
byte[] readBuffer = new byte[1024]; byte[] readBuffer = new byte[1024];
while (true) while (true)
{ {
int bytesRead = await _socket.ReceiveAsync(readBuffer); if (_cts != null && _cts.IsCancellationRequested)
if (bytesRead < 1)
break; break;
string data = Encoding.ASCII.GetString(readBuffer, 0, bytesRead); int bytesRead = _cts != null && _cts.IsCancellationRequested ? 0 : await _socket.ReceiveAsync(readBuffer);
if (bytesRead < 1)
{
if (sb.Length > 0 && this.MessageCallback != null)
this.MessageCallback(this, sb.ToString());
break;
}
string data = Encoding.ASCII.GetString(readBuffer, 0, bytesRead);
sb.Append(data); sb.Append(data);
if (!data.EndsWith("\r\n>")) if (!data.EndsWith("\r\n>"))
@ -69,25 +79,31 @@ namespace ConsoleApp.TelnetSamples
sb.Clear(); sb.Clear();
} }
} }
catch (Exception) catch (Exception ex)
{ {
throw; if (this.ErrorCallback != null)
} this.ErrorCallback(this, ex);
} }
}
public async void SendCommand(string command) public async void SendCommand(string command)
{ {
try try
{ {
command = command.Replace(" ", "");
if (string.IsNullOrEmpty(command))
return;
command += "\r\n"; command += "\r\n";
byte[] sendBytes = Encoding.ASCII.GetBytes(command); byte[] sendBytes = Encoding.ASCII.GetBytes(command);
await _socket.SendAsync(sendBytes); await _socket.SendAsync(sendBytes);
} }
catch (Exception) catch (Exception ex)
{ {
throw; if (this.ErrorCallback != null)
} this.ErrorCallback(this, ex);
} }
}
public void Close() public void Close()
{ {
@ -96,14 +112,17 @@ namespace ConsoleApp.TelnetSamples
if (_socket == null) if (_socket == null)
return; return;
_cts.Cancel();
_socket.Shutdown(SocketShutdown.Both); _socket.Shutdown(SocketShutdown.Both);
_socket.Close(); _socket.Close();
_socket.Dispose(); _socket.Dispose();
} }
catch (Exception) catch (Exception ex)
{ {
throw; if (this.ErrorCallback != null)
} this.ErrorCallback(this, ex);
} }
}
} }
} }

@ -7,11 +7,12 @@ using System.Threading.Tasks;
namespace ConsoleApp.TelnetSamples namespace ConsoleApp.TelnetSamples
{ {
internal class AsyncStreamTelnetClient : IAsyncTelnetClient internal class AsyncStreamTelnetClient : IAsyncTelnetClient
{ {
public event EventHandler<string> MessageCallback; public event EventHandler<string> MessageCallback;
public event EventHandler<Exception> ErrorCallback;
private TcpClient _client; private TcpClient _client;
private NetworkStream _stream; private NetworkStream _stream;
public async void Connect(string ip, int port = 23) public async void Connect(string ip, int port = 23)

@ -20,23 +20,33 @@ namespace ConsoleApp.TelnetSamples
try try
{ {
_client.MessageCallback += On_Receive; _client.MessageCallback += On_Receive;
_client.ErrorCallback += On_ErrorCallback;
_client.Connect(ip, port); _client.Connect(ip, port);
while (true) while (true)
{ {
string command = Console.ReadLine(); string command = Console.ReadLine().ToLower();
if (command == "quit" || command == "exit") if (command == "quit" || command == "exit")
break; break;
else if (command == "disconnect" || command == "disconn")
_client.SendCommand(command); _client.Close();
else if (command == "connect" || command == "conn")
_client.Connect(ip, port);
else
_client.SendCommand(command);
} }
} }
catch (Exception) catch (Exception ex)
{ {
throw; Console.WriteLine($"[ERR] {ex.Message}");
} }
} }
private void On_ErrorCallback(object? sender, Exception e)
{
Console.WriteLine(e.Message);
}
private void On_Receive(object? sender, string e) private void On_Receive(object? sender, string e)
{ {
Console.Write(e); Console.Write(e);

@ -9,6 +9,7 @@ namespace ConsoleApp.TelnetSamples
public interface IAsyncTelnetClient public interface IAsyncTelnetClient
{ {
public event EventHandler<string> MessageCallback; public event EventHandler<string> MessageCallback;
public event EventHandler<Exception> ErrorCallback;
void Connect(string ip, int port = 23); void Connect(string ip, int port = 23);
void SendCommand(string command); void SendCommand(string command);

@ -24,11 +24,15 @@ namespace ConsoleApp.TelnetSamples
while (true) while (true)
{ {
string command = Console.ReadLine(); string command = Console.ReadLine().ToLower();
if (command == "quit" || command == "exit") if (command == "quit" || command == "exit")
break; break;
else if (command == "disconnect" || command == "disconn")
Console.Write(_client.SendCommand(command)); _client.Close();
else if (command == "connect" || command == "conn")
_client.Connect(ip, port);
else
Console.Write(_client.SendCommand(command));
} }
} }
catch (Exception ex) catch (Exception ex)

@ -28,200 +28,200 @@
/// </summary> /// </summary>
private void InitializeComponent() private void InitializeComponent()
{ {
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(SerialCommApp)); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(SerialCommApp));
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel(); this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
this.connectButton = new System.Windows.Forms.Button(); this.connectButton = new System.Windows.Forms.Button();
this.panel1 = new System.Windows.Forms.Panel(); this.panel1 = new System.Windows.Forms.Panel();
this.settingButton = new System.Windows.Forms.Button(); this.portRefreshButton = new System.Windows.Forms.Button();
this.label1 = new System.Windows.Forms.Label(); this.settingButton = new System.Windows.Forms.Button();
this.portComboBox = new System.Windows.Forms.ComboBox(); this.label1 = new System.Windows.Forms.Label();
this.tableLayoutPanel3 = new System.Windows.Forms.TableLayoutPanel(); this.portComboBox = new System.Windows.Forms.ComboBox();
this.sendButton = new System.Windows.Forms.Button(); this.tableLayoutPanel3 = new System.Windows.Forms.TableLayoutPanel();
this.commandText = new System.Windows.Forms.TextBox(); this.sendButton = new System.Windows.Forms.Button();
this.printText = new System.Windows.Forms.TextBox(); this.commandText = new System.Windows.Forms.TextBox();
this.portRefreshButton = new System.Windows.Forms.Button(); this.printText = new System.Windows.Forms.TextBox();
this.tableLayoutPanel1.SuspendLayout(); this.tableLayoutPanel1.SuspendLayout();
this.tableLayoutPanel2.SuspendLayout(); this.tableLayoutPanel2.SuspendLayout();
this.panel1.SuspendLayout(); this.panel1.SuspendLayout();
this.tableLayoutPanel3.SuspendLayout(); this.tableLayoutPanel3.SuspendLayout();
this.SuspendLayout(); this.SuspendLayout();
// //
// tableLayoutPanel1 // tableLayoutPanel1
// //
this.tableLayoutPanel1.BackColor = System.Drawing.Color.White; this.tableLayoutPanel1.BackColor = System.Drawing.Color.White;
this.tableLayoutPanel1.ColumnCount = 1; this.tableLayoutPanel1.ColumnCount = 1;
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel1.Controls.Add(this.tableLayoutPanel2, 0, 0); this.tableLayoutPanel1.Controls.Add(this.tableLayoutPanel2, 0, 0);
this.tableLayoutPanel1.Controls.Add(this.tableLayoutPanel3, 0, 2); this.tableLayoutPanel1.Controls.Add(this.tableLayoutPanel3, 0, 2);
this.tableLayoutPanel1.Controls.Add(this.printText, 0, 1); this.tableLayoutPanel1.Controls.Add(this.printText, 0, 1);
this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill; this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0); this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0);
this.tableLayoutPanel1.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.tableLayoutPanel1.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.tableLayoutPanel1.Name = "tableLayoutPanel1"; this.tableLayoutPanel1.Name = "tableLayoutPanel1";
this.tableLayoutPanel1.RowCount = 3; this.tableLayoutPanel1.RowCount = 3;
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 40F)); this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 40F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 40F)); this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 40F));
this.tableLayoutPanel1.Size = new System.Drawing.Size(583, 679); this.tableLayoutPanel1.Size = new System.Drawing.Size(583, 679);
this.tableLayoutPanel1.TabIndex = 6; this.tableLayoutPanel1.TabIndex = 6;
// //
// tableLayoutPanel2 // tableLayoutPanel2
// //
this.tableLayoutPanel2.BackColor = System.Drawing.Color.White; this.tableLayoutPanel2.BackColor = System.Drawing.Color.White;
this.tableLayoutPanel2.ColumnCount = 3; this.tableLayoutPanel2.ColumnCount = 3;
this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 350F)); this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 350F));
this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 100F)); this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 100F));
this.tableLayoutPanel2.Controls.Add(this.connectButton, 2, 0); this.tableLayoutPanel2.Controls.Add(this.connectButton, 2, 0);
this.tableLayoutPanel2.Controls.Add(this.panel1, 0, 0); this.tableLayoutPanel2.Controls.Add(this.panel1, 0, 0);
this.tableLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill; this.tableLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanel2.Location = new System.Drawing.Point(3, 4); this.tableLayoutPanel2.Location = new System.Drawing.Point(3, 4);
this.tableLayoutPanel2.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.tableLayoutPanel2.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.tableLayoutPanel2.Name = "tableLayoutPanel2"; this.tableLayoutPanel2.Name = "tableLayoutPanel2";
this.tableLayoutPanel2.RowCount = 1; this.tableLayoutPanel2.RowCount = 1;
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel2.Size = new System.Drawing.Size(577, 32); this.tableLayoutPanel2.Size = new System.Drawing.Size(577, 32);
this.tableLayoutPanel2.TabIndex = 6; this.tableLayoutPanel2.TabIndex = 6;
// //
// connectButton // connectButton
// //
this.connectButton.Dock = System.Windows.Forms.DockStyle.Fill; this.connectButton.Dock = System.Windows.Forms.DockStyle.Fill;
this.connectButton.Location = new System.Drawing.Point(480, 4); this.connectButton.Location = new System.Drawing.Point(480, 4);
this.connectButton.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.connectButton.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.connectButton.Name = "connectButton"; this.connectButton.Name = "connectButton";
this.connectButton.Size = new System.Drawing.Size(94, 24); this.connectButton.Size = new System.Drawing.Size(94, 24);
this.connectButton.TabIndex = 1; this.connectButton.TabIndex = 1;
this.connectButton.Text = "Connect"; this.connectButton.Text = "Connect";
this.connectButton.UseVisualStyleBackColor = true; this.connectButton.UseVisualStyleBackColor = true;
this.connectButton.Click += new System.EventHandler(this.connectButton_Click); this.connectButton.Click += new System.EventHandler(this.connectButton_Click);
// //
// panel1 // panel1
// //
this.panel1.Controls.Add(this.portRefreshButton); this.panel1.Controls.Add(this.portRefreshButton);
this.panel1.Controls.Add(this.settingButton); this.panel1.Controls.Add(this.settingButton);
this.panel1.Controls.Add(this.label1); this.panel1.Controls.Add(this.label1);
this.panel1.Controls.Add(this.portComboBox); this.panel1.Controls.Add(this.portComboBox);
this.panel1.Dock = System.Windows.Forms.DockStyle.Fill; this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.panel1.Location = new System.Drawing.Point(0, 0); this.panel1.Location = new System.Drawing.Point(0, 0);
this.panel1.Margin = new System.Windows.Forms.Padding(0); this.panel1.Margin = new System.Windows.Forms.Padding(0);
this.panel1.Name = "panel1"; this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(350, 32); this.panel1.Size = new System.Drawing.Size(350, 32);
this.panel1.TabIndex = 2; this.panel1.TabIndex = 2;
// //
// settingButton // portRefreshButton
// //
this.settingButton.Location = new System.Drawing.Point(207, 3); this.portRefreshButton.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("portRefreshButton.BackgroundImage")));
this.settingButton.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.portRefreshButton.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom;
this.settingButton.Name = "settingButton"; this.portRefreshButton.Location = new System.Drawing.Point(159, 4);
this.settingButton.Size = new System.Drawing.Size(68, 24); this.portRefreshButton.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.settingButton.TabIndex = 1; this.portRefreshButton.Name = "portRefreshButton";
this.settingButton.Text = "Setting"; this.portRefreshButton.Size = new System.Drawing.Size(25, 24);
this.settingButton.UseVisualStyleBackColor = true; this.portRefreshButton.TabIndex = 2;
this.settingButton.Click += new System.EventHandler(this.settingButton_Click); this.portRefreshButton.UseVisualStyleBackColor = true;
// this.portRefreshButton.Click += new System.EventHandler(this.portRefreshButton_Click);
// label1 //
// // settingButton
this.label1.AutoSize = true; //
this.label1.Location = new System.Drawing.Point(2, 9); this.settingButton.Location = new System.Drawing.Point(207, 3);
this.label1.Name = "label1"; this.settingButton.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.label1.Size = new System.Drawing.Size(29, 15); this.settingButton.Name = "settingButton";
this.label1.TabIndex = 0; this.settingButton.Size = new System.Drawing.Size(68, 24);
this.label1.Text = "Port"; this.settingButton.TabIndex = 1;
// this.settingButton.Text = "Setting";
// portComboBox this.settingButton.UseVisualStyleBackColor = true;
// this.settingButton.Click += new System.EventHandler(this.settingButton_Click);
this.portComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; //
this.portComboBox.FormattingEnabled = true; // label1
this.portComboBox.Location = new System.Drawing.Point(37, 4); //
this.portComboBox.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.label1.AutoSize = true;
this.portComboBox.Name = "portComboBox"; this.label1.Location = new System.Drawing.Point(2, 9);
this.portComboBox.Size = new System.Drawing.Size(116, 23); this.label1.Name = "label1";
this.portComboBox.TabIndex = 0; this.label1.Size = new System.Drawing.Size(29, 15);
// this.label1.TabIndex = 0;
// tableLayoutPanel3 this.label1.Text = "Port";
// //
this.tableLayoutPanel3.BackColor = System.Drawing.Color.White; // portComboBox
this.tableLayoutPanel3.ColumnCount = 2; //
this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); this.portComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 100F)); this.portComboBox.FormattingEnabled = true;
this.tableLayoutPanel3.Controls.Add(this.sendButton, 1, 0); this.portComboBox.Location = new System.Drawing.Point(37, 4);
this.tableLayoutPanel3.Controls.Add(this.commandText, 0, 0); this.portComboBox.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.tableLayoutPanel3.Dock = System.Windows.Forms.DockStyle.Fill; this.portComboBox.Name = "portComboBox";
this.tableLayoutPanel3.Location = new System.Drawing.Point(3, 643); this.portComboBox.Size = new System.Drawing.Size(116, 23);
this.tableLayoutPanel3.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.portComboBox.TabIndex = 0;
this.tableLayoutPanel3.Name = "tableLayoutPanel3"; //
this.tableLayoutPanel3.RowCount = 1; // tableLayoutPanel3
this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); //
this.tableLayoutPanel3.Size = new System.Drawing.Size(577, 32); this.tableLayoutPanel3.BackColor = System.Drawing.Color.White;
this.tableLayoutPanel3.TabIndex = 6; this.tableLayoutPanel3.ColumnCount = 2;
// this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
// sendButton this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 100F));
// this.tableLayoutPanel3.Controls.Add(this.sendButton, 1, 0);
this.sendButton.Dock = System.Windows.Forms.DockStyle.Fill; this.tableLayoutPanel3.Controls.Add(this.commandText, 0, 0);
this.sendButton.Location = new System.Drawing.Point(480, 4); this.tableLayoutPanel3.Dock = System.Windows.Forms.DockStyle.Fill;
this.sendButton.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.tableLayoutPanel3.Location = new System.Drawing.Point(3, 643);
this.sendButton.Name = "sendButton"; this.tableLayoutPanel3.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.sendButton.Size = new System.Drawing.Size(94, 24); this.tableLayoutPanel3.Name = "tableLayoutPanel3";
this.sendButton.TabIndex = 1; this.tableLayoutPanel3.RowCount = 1;
this.sendButton.Text = "Send"; this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.sendButton.UseVisualStyleBackColor = true; this.tableLayoutPanel3.Size = new System.Drawing.Size(577, 32);
this.sendButton.Click += new System.EventHandler(this.sendButton_Click); this.tableLayoutPanel3.TabIndex = 6;
// //
// commandText // sendButton
// //
this.commandText.Dock = System.Windows.Forms.DockStyle.Fill; this.sendButton.Dock = System.Windows.Forms.DockStyle.Fill;
this.commandText.Location = new System.Drawing.Point(3, 4); this.sendButton.Location = new System.Drawing.Point(480, 4);
this.commandText.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.sendButton.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.commandText.Name = "commandText"; this.sendButton.Name = "sendButton";
this.commandText.Size = new System.Drawing.Size(471, 23); this.sendButton.Size = new System.Drawing.Size(94, 24);
this.commandText.TabIndex = 0; this.sendButton.TabIndex = 1;
// this.sendButton.Text = "Send";
// printText this.sendButton.UseVisualStyleBackColor = true;
// this.sendButton.Click += new System.EventHandler(this.sendButton_Click);
this.printText.BackColor = System.Drawing.Color.White; //
this.printText.Dock = System.Windows.Forms.DockStyle.Fill; // commandText
this.printText.Location = new System.Drawing.Point(3, 44); //
this.printText.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.commandText.Dock = System.Windows.Forms.DockStyle.Fill;
this.printText.Multiline = true; this.commandText.Location = new System.Drawing.Point(3, 4);
this.printText.Name = "printText"; this.commandText.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.printText.ReadOnly = true; this.commandText.Name = "commandText";
this.printText.ScrollBars = System.Windows.Forms.ScrollBars.Vertical; this.commandText.Size = new System.Drawing.Size(471, 23);
this.printText.Size = new System.Drawing.Size(577, 591); this.commandText.TabIndex = 0;
this.printText.TabIndex = 2; //
this.printText.TabStop = false; // printText
// //
// portRefreshButton this.printText.BackColor = System.Drawing.Color.White;
// this.printText.Dock = System.Windows.Forms.DockStyle.Fill;
this.portRefreshButton.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("portRefreshButton.BackgroundImage"))); this.printText.Location = new System.Drawing.Point(3, 44);
this.portRefreshButton.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom; this.printText.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.portRefreshButton.Location = new System.Drawing.Point(159, 4); this.printText.Multiline = true;
this.portRefreshButton.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.printText.Name = "printText";
this.portRefreshButton.Name = "portRefreshButton"; this.printText.ReadOnly = true;
this.portRefreshButton.Size = new System.Drawing.Size(25, 24); this.printText.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
this.portRefreshButton.TabIndex = 2; this.printText.Size = new System.Drawing.Size(577, 591);
this.portRefreshButton.UseVisualStyleBackColor = true; this.printText.TabIndex = 2;
this.portRefreshButton.Click += new System.EventHandler(this.portRefreshButton_Click); this.printText.TabStop = false;
// //
// SerialCommApp // SerialCommApp
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(583, 679); this.ClientSize = new System.Drawing.Size(583, 679);
this.Controls.Add(this.tableLayoutPanel1); this.Controls.Add(this.tableLayoutPanel1);
this.Font = new System.Drawing.Font("맑은 고딕", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129))); this.Font = new System.Drawing.Font("맑은 고딕", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.Name = "SerialCommApp"; this.Name = "SerialCommApp";
this.Text = "Serial Communication Application"; this.Text = "Serial Communication Application";
this.tableLayoutPanel1.ResumeLayout(false); this.tableLayoutPanel1.ResumeLayout(false);
this.tableLayoutPanel1.PerformLayout(); this.tableLayoutPanel1.PerformLayout();
this.tableLayoutPanel2.ResumeLayout(false); this.tableLayoutPanel2.ResumeLayout(false);
this.panel1.ResumeLayout(false); this.panel1.ResumeLayout(false);
this.panel1.PerformLayout(); this.panel1.PerformLayout();
this.tableLayoutPanel3.ResumeLayout(false); this.tableLayoutPanel3.ResumeLayout(false);
this.tableLayoutPanel3.PerformLayout(); this.tableLayoutPanel3.PerformLayout();
this.ResumeLayout(false); this.ResumeLayout(false);
} }

@ -120,20 +120,20 @@
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="portRefreshButton.BackgroundImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <data name="portRefreshButton.BackgroundImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value> <value>
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 OvUDT7UkAAAAAElFTkSuQmCC
</value> </value>
</data> </data>
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">

Loading…
Cancel
Save