Client.cs
上传用户:lxycoco
上传日期:2022-07-21
资源大小:38457k
文件大小:1k
源码类别:

C#编程

开发平台:

Others

  1. using System;
  2. using System.Runtime.Remoting.Messaging;
  3. using System.Runtime.Remoting.Channels;
  4. using System.Runtime.Remoting.Channels.Tcp;
  5. using System.Runtime.Remoting.Channels.Http;
  6. using System.Runtime.Remoting;
  7. using System.Runtime.Remoting.Activation;
  8. using System.Runtime.Remoting.Lifetime;
  9. namespace Wrox.ProCSharp.Remoting
  10. {
  11. public class Client
  12. {
  13. public static void Main(string[] args)
  14. {
  15. RemotingConfiguration.Configure("Client.exe.config");
  16. EventSink sink = new EventSink();
  17. RemoteObject obj = new RemoteObject();
  18. obj.Status += new StatusEvent(sink.StatusHandler);
  19. obj.LongWorking(5000);
  20. obj.Status -= new StatusEvent(sink.StatusHandler);
  21. obj.LongWorking(5000);
  22. Console.WriteLine("press return to exit");
  23. Console.ReadLine();
  24. }
  25. }
  26. }