HelloServer.cs
上传用户:lxycoco
上传日期:2022-07-21
资源大小:38457k
文件大小:1k
- using System;
- using System.Runtime.Remoting;
- using System.Runtime.Remoting.Channels;
- using System.Runtime.Remoting.Channels.Tcp;
- using System.Runtime.Remoting.Channels.Http;
- using System.Collections;
- namespace Wrox.ProCSharp.Remoting
- {
- public class HelloServer
- {
- public static void ShowWellKnownServiceTypes()
- {
- WellKnownServiceTypeEntry[] entries =
- RemotingConfiguration.GetRegisteredWellKnownServiceTypes();
- foreach (WellKnownServiceTypeEntry entry in entries)
- {
- Console.WriteLine("Assembly: " + entry.AssemblyName);
- Console.WriteLine("Mode: " + entry.Mode);
- Console.WriteLine("URI: " + entry.ObjectUri);
- Console.WriteLine("Type: " + entry.TypeName);
- }
- }
- public static void ShowActivatedServiceTypes()
- {
- ActivatedServiceTypeEntry[] entries =
- RemotingConfiguration.GetRegisteredActivatedServiceTypes();
- foreach (ActivatedServiceTypeEntry entry in entries)
- {
- Console.WriteLine("Assembly: " + entry.AssemblyName);
- Console.WriteLine("Type: " + entry.TypeName);
- }
- }
- public static void Main(string[] args)
- {
- RemotingConfiguration.Configure("HelloServer.exe.config");
- Console.WriteLine("Application: " + RemotingConfiguration.ApplicationName);
- ShowActivatedServiceTypes();
- ShowWellKnownServiceTypes();
- System.Console.WriteLine("press return to exit");
- System.Console.ReadLine();
- }
- }
- }