private void button1_Click(object sender, System.EventArgs e) { label3.Text = ("Paused"); timer3.Stop(); IMyRemoteObject obj = (IMyRemoteObject)Activator.GetObject(typeof(IMyRemoteObject), "http://localhost:1234/MyRemoteObject.soap"); string a = "a"; obj.SetValue(a); }
private void button8_Click_1(object sender, EventArgs e) { label3.Text = ("Paused"); timer3.Stop(); IMyRemoteObject obj = (IMyRemoteObject)Activator.GetObject(typeof(IMyRemoteObject), "http://localhost:1234/MyRemoteObject.soap"); string a = "a"; obj.SetValue(a); Form3 f3 = new Form3(); f3.ShowDialog(); }
static void Main(string[] args) { HttpChannel channel = new HttpChannel(); ChannelServices.RegisterChannel(channel); IMyRemoteObject obj = (IMyRemoteObject)Activator.GetObject( typeof(IMyRemoteObject), "http://localhost:1234/MyRemoteObject.soap"); Console.WriteLine("Client.Main(): Reference to rem.obj. acquired"); int tmp = obj.GetValue(); Console.WriteLine("Client.Main(): Original server side value: {0}", tmp); Console.WriteLine("Client.Main(): Will set value to 42"); obj.SetValue(42); tmp = obj.GetValue(); Console.WriteLine("Client.Main(): New server side value {0}", tmp); Console.ReadLine(); }
static void Main(string[] args) { DateTime start = System.DateTime.Now; HttpChannel channel = new HttpChannel(); ChannelServices.RegisterChannel(channel); IMyRemoteObject obj = (IMyRemoteObject)Activator.GetObject( typeof(IMyRemoteObject), "http://localhost:1234/MyRemoteObject.soap"); Console.WriteLine("Client.Main(): Reference to rem.obj. acquired"); Console.WriteLine("Client.Main(): Will set value to 42"); obj.SetValue(42); Console.WriteLine("Client.Main(): Will now read value"); int tmp = obj.GetValue(); Console.WriteLine("Client.Main(): New server side value {0}", tmp); Console.WriteLine("Client.Main(): Will call getName()"); String name = obj.GetName(); Console.WriteLine("Client.Main(): received name {0}", name); DateTime end = System.DateTime.Now; TimeSpan duration = end.Subtract(start); Console.WriteLine("Client.Main(): Execution took {0} seconds.", duration.Seconds); Console.ReadLine(); }
static void Main(string[] args) { HttpChannel channel = new HttpChannel(); ChannelServices.RegisterChannel(channel); IMyRemoteObject obj = (IMyRemoteObject)Activator.GetObject( typeof(IMyRemoteObject), "http://localhost:1234/MyRemoteObject.soap"); Console.WriteLine("Client.Main(): Reference to rem.obj. acquired"); Console.WriteLine("Client.Main(): Will call setValue(42)"); try { obj.SetValue(42); Console.WriteLine("Client.Main(): Value successfully set."); } catch (Exception e) { Console.WriteLine("Client.Main(): EXCEPTION.\n{0}", e.Message); } // wait for keypress Console.ReadLine(); }