static void Main(string[] args) { Console.WriteLine("Press ENTER for start the client"); Console.ReadLine(); // Create a proxy object and connect to the service clsProxy myProxy = new clsProxy(); try { myProxy.Open(); Console.WriteLine(myProxy.GetEco("Buongiorno Leonardo")); Console.WriteLine("Press ENTER to stop the service"); Console.ReadLine(); } catch(Exception ex) { Console.WriteLine(ex.Message); if (ex.InnerException != null) { Console.WriteLine(ex.InnerException.Message); } } finally { myProxy.Close(); } }
private void btnStart_Click(object sender, EventArgs e) { clsProxy clsP = new clsProxy(Int32.Parse("" + numericUpDown1.Value), Int32.Parse("" + numericUpDown2.Value), Int32.Parse("" + numericUpDown3.Value)); t = new Thread(clsP.Run); t.Start(); Globals.sStatus = "Running..."; Globals.cStatus = System.Drawing.Color.Green; Globals.bStart = false; Globals.bPause = true; }