本文整理汇总了C#中System.Runtime.Remoting.ActivatedServiceTypeEntry类的典型用法代码示例。如果您正苦于以下问题:C# ActivatedServiceTypeEntry类的具体用法?C# ActivatedServiceTypeEntry怎么用?C# ActivatedServiceTypeEntry使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ActivatedServiceTypeEntry类属于System.Runtime.Remoting命名空间,在下文中一共展示了ActivatedServiceTypeEntry类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Main
//引入命名空间
using System;
using System.Runtime.Remoting;
using System.Runtime.Remoting.Channels;
using System.Runtime.Remoting.Channels.Tcp;
public class MyClient
{
public static void Main()
{
ChannelServices.RegisterChannel(new TcpChannel(8082));
// Create an instance of 'ActivatedServiceTypeEntry' class
// which holds the values for 'HelloServer' type.
ActivatedServiceTypeEntry myActivatedServiceTypeEntry =
new ActivatedServiceTypeEntry(typeof(HelloServer));
// Register an object Type on the service end so that
// it can be activated on request from a client.
RemotingConfiguration.RegisterActivatedServiceType(
myActivatedServiceTypeEntry);
// Get the registered activated service types .
ActivatedServiceTypeEntry[] myActivatedServiceEntries =
RemotingConfiguration.GetRegisteredActivatedServiceTypes();
Console.WriteLine("Information of first registered activated "
+" service type :");
Console.WriteLine("Object type: "
+myActivatedServiceEntries[0].ObjectType);
Console.WriteLine("Description: "
+myActivatedServiceEntries[0].ToString());
Console.WriteLine("Press enter to stop this process");
Console.ReadLine();
}
}