diff --git a/SamaPager_Client/Client.cs b/SamaPager_Client/Client.cs
index d20c942..8c26def 100644
--- a/SamaPager_Client/Client.cs
+++ b/SamaPager_Client/Client.cs
@@ -5,6 +5,7 @@ using System.Net;
using System.Net.Sockets;
using System.Text;
using System.Threading.Tasks;
+using System.Windows.Forms;
namespace SamaPager_Client
{
@@ -41,6 +42,23 @@ namespace SamaPager_Client
UdpStack.Send(msgData, msgData.Length, serverEndPoint);
}
+ internal string SendCommand(string command)
+ {
+ byte[] msgData = Encoding.UTF8.GetBytes(command);
+ UdpStack.Send(msgData, msgData.Length, serverEndPoint);
+ try
+ {
+ UdpStack.Client.ReceiveTimeout = 5000;
+ IPEndPoint receiveEndPoint = serverEndPoint;
+ byte[] receivedBytes = UdpStack.Receive(ref receiveEndPoint);
+ return $"Server replied: {Encoding.UTF8.GetString(receivedBytes)}";
+ }
+ catch(Exception ex)
+ {
+ return $"ERROR: {ex.Message}";
+ }
+ }
+
internal void KillClient()
{
this.UdpStack.Close();
diff --git a/SamaPager_Client/Form1.Designer.cs b/SamaPager_Client/Form1.Designer.cs
index 25cfe24..7416325 100644
--- a/SamaPager_Client/Form1.Designer.cs
+++ b/SamaPager_Client/Form1.Designer.cs
@@ -31,7 +31,7 @@
this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1));
this.kryptonPanel1 = new Krypton.Toolkit.KryptonPanel();
- this.kryptonComboBox1 = new Krypton.Toolkit.KryptonComboBox();
+ this.cmdLst = new Krypton.Toolkit.KryptonComboBox();
this.logLst = new Krypton.Toolkit.KryptonListBox();
this.kryptonPictureBox1 = new Krypton.Toolkit.KryptonPictureBox();
this.sendBtn = new Krypton.Toolkit.KryptonButton();
@@ -45,7 +45,7 @@
this.kryptonManager2 = new Krypton.Toolkit.KryptonManager(this.components);
((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).BeginInit();
this.kryptonPanel1.SuspendLayout();
- ((System.ComponentModel.ISupportInitialize)(this.kryptonComboBox1)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this.cmdLst)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.kryptonPictureBox1)).BeginInit();
this.kryptonStatusStrip1.SuspendLayout();
this.menuStrip1.SuspendLayout();
@@ -53,7 +53,7 @@
//
// kryptonPanel1
//
- this.kryptonPanel1.Controls.Add(this.kryptonComboBox1);
+ this.kryptonPanel1.Controls.Add(this.cmdLst);
this.kryptonPanel1.Controls.Add(this.logLst);
this.kryptonPanel1.Controls.Add(this.kryptonPictureBox1);
this.kryptonPanel1.Controls.Add(this.sendBtn);
@@ -63,16 +63,16 @@
resources.ApplyResources(this.kryptonPanel1, "kryptonPanel1");
this.kryptonPanel1.Name = "kryptonPanel1";
//
- // kryptonComboBox1
+ // cmdLst
//
- this.kryptonComboBox1.DropDownWidth = 318;
- this.kryptonComboBox1.Items.AddRange(new object[] {
- resources.GetString("kryptonComboBox1.Items"),
- resources.GetString("kryptonComboBox1.Items1"),
- resources.GetString("kryptonComboBox1.Items2")});
- resources.ApplyResources(this.kryptonComboBox1, "kryptonComboBox1");
- this.kryptonComboBox1.Name = "kryptonComboBox1";
- this.kryptonComboBox1.StateCommon.ComboBox.Content.TextH = Krypton.Toolkit.PaletteRelativeAlign.Near;
+ this.cmdLst.DropDownWidth = 318;
+ this.cmdLst.Items.AddRange(new object[] {
+ resources.GetString("cmdLst.Items"),
+ resources.GetString("cmdLst.Items1"),
+ resources.GetString("cmdLst.Items2")});
+ resources.ApplyResources(this.cmdLst, "cmdLst");
+ this.cmdLst.Name = "cmdLst";
+ this.cmdLst.StateCommon.ComboBox.Content.TextH = Krypton.Toolkit.PaletteRelativeAlign.Near;
//
// logLst
//
@@ -157,7 +157,7 @@
((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).EndInit();
this.kryptonPanel1.ResumeLayout(false);
this.kryptonPanel1.PerformLayout();
- ((System.ComponentModel.ISupportInitialize)(this.kryptonComboBox1)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this.cmdLst)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.kryptonPictureBox1)).EndInit();
this.kryptonStatusStrip1.ResumeLayout(false);
this.kryptonStatusStrip1.PerformLayout();
@@ -181,7 +181,7 @@
private System.Windows.Forms.ToolStripMenuItem changeDestinationAddressToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem restartUDPClientToolStripMenuItem;
private Krypton.Toolkit.KryptonListBox logLst;
- private Krypton.Toolkit.KryptonComboBox kryptonComboBox1;
+ private Krypton.Toolkit.KryptonComboBox cmdLst;
}
}
diff --git a/SamaPager_Client/Form1.cs b/SamaPager_Client/Form1.cs
index cf3a02c..7cb6c19 100644
--- a/SamaPager_Client/Form1.cs
+++ b/SamaPager_Client/Form1.cs
@@ -55,6 +55,7 @@ namespace SamaPager_Client
else
{
pageClient.SendMessage(messageTxt.Text);
+ logLst.Items.Add($"Sent: {messageTxt.Text}");
messageTxt.Text = String.Empty;
}
diff --git a/SamaPager_Client/Form1.it-IT.resx b/SamaPager_Client/Form1.it-IT.resx
index 7eb0b11..8ad66e3 100644
--- a/SamaPager_Client/Form1.it-IT.resx
+++ b/SamaPager_Client/Form1.it-IT.resx
@@ -122,16 +122,16 @@
- 0, 556
+ 0, 550
- 347, 22
+ 349, 22
- 347, 24
+ 349, 24
- 347, 578
+ 349, 572
42, 20
@@ -152,6 +152,6 @@
Riavvia il socket UDP
- 347, 578
+ 349, 572
\ No newline at end of file
diff --git a/SamaPager_Client/Form1.resx b/SamaPager_Client/Form1.resx
index 9e5fab4..53ca6de 100644
--- a/SamaPager_Client/Form1.resx
+++ b/SamaPager_Client/Form1.resx
@@ -117,36 +117,36 @@
System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
+
!getDateTime
-
+
!getCurrentDir
-
+
!getCurrentUser
-
+
12, 524
-
+
318, 22
-
+
6
-
- kryptonComboBox1
+
+ cmdLst
-
+
Krypton.Toolkit.KryptonComboBox, Krypton.Toolkit, Version=95.25.8.235, Culture=neutral, PublicKeyToken=a87e673e9ecb6e8e
-
+
kryptonPanel1
-
+
0
@@ -235,10 +235,10 @@
STATUS: Off
- 0, 554
+ 0, 536
- 344, 22
+ 350, 22
1
@@ -264,6 +264,18 @@
Segoe UI, 9pt
+
+ 220, 22
+
+
+ Change destination address
+
+
+ 220, 22
+
+
+ Restart UDP Client
+
64, 20
@@ -274,7 +286,7 @@
0, 0
- 344, 24
+ 350, 24
4
@@ -325,7 +337,7 @@
0, 0
- 344, 576
+ 350, 558
0
@@ -342,18 +354,6 @@
0
-
- 220, 22
-
-
- Change destination address
-
-
- 220, 22
-
-
- Restart UDP Client
-
17, 17
@@ -364,7 +364,7 @@
6, 13
- 344, 576
+ 350, 558
CenterScreen
diff --git a/SamaPager_Client/SamaPager_Client.csproj b/SamaPager_Client/SamaPager_Client.csproj
index f596962..9df25bd 100644
--- a/SamaPager_Client/SamaPager_Client.csproj
+++ b/SamaPager_Client/SamaPager_Client.csproj
@@ -61,9 +61,11 @@
Form1.cs
+ Designer
Form1.cs
+ Designer
ResXFileCodeGenerator