Client.cs
上传用户:lxycoco
上传日期:2022-07-21
资源大小:38457k
文件大小:1k
- using System;
- using System.Runtime.Remoting.Messaging;
- using System.Runtime.Remoting.Channels;
- using System.Runtime.Remoting.Channels.Tcp;
- using System.Runtime.Remoting.Channels.Http;
- using System.Runtime.Remoting;
- using System.Runtime.Remoting.Activation;
- using System.Runtime.Remoting.Lifetime;
- namespace Wrox.ProCSharp.Remoting
- {
- public class Client
- {
- public static void Main(string[] args)
- {
- RemotingConfiguration.Configure("Client.exe.config");
- EventSink sink = new EventSink();
- RemoteObject obj = new RemoteObject();
- obj.Status += new StatusEvent(sink.StatusHandler);
- obj.LongWorking(5000);
- obj.Status -= new StatusEvent(sink.StatusHandler);
- obj.LongWorking(5000);
- Console.WriteLine("press return to exit");
- Console.ReadLine();
- }
- }
- }