Server.cs
上传用户:jasonxu888
上传日期:2007-03-28
资源大小:4316k
文件大小:1k
源码类别:

.net编程

开发平台:

C#

  1. using System;
  2. using System.Runtime.Remoting;
  3. using System.Threading;
  4. using General;
  5. namespace Server
  6. {
  7. public class SomeSAO: MarshalByRefObject, IMySAO
  8. {
  9. public void DoSomething() 
  10. {
  11. // simulating a long-running query
  12. Console.WriteLine("DoSomething() called");
  13. Thread.Sleep(5000);
  14. Console.WriteLine("DoSomething() done");
  15. }
  16. }
  17. class ServerStartup
  18. {
  19. static void Main(string[] args)
  20. {
  21. String filename = "server.exe.config";
  22. RemotingConfiguration.Configure(filename);
  23. Console.WriteLine ("Server started, press <return> to exit.");
  24. Console.ReadLine();
  25. }
  26. }
  27. }