
using System.Runtime.Remoting.Channels;

using System.Runtime.Remoting.Channels.Tcp;

using System.Runtime.Remoting;


namespace RemoteSample

{

class server

{

static int Main(string[] args)

{

//注册通道

TcpChannel chan = new TcpChannel(8085);

ChannelServices.RegisterChannel(chan);

string sshan = chan.ChannelName;

System.Console.WriteLine(sshan);

//注册远程对象,即激活.

RemotingConfiguration.RegisterWellKnownServiceType(typeof(RemoteSample.HelloServer), "SayHello", WellKnownObjectMode.SingleCall);

System.Console.WriteLine("Hit <ennter> to exit...");

System.Console.ReadLine();

return 0;

}

}

}