public Form1() { InitializeComponent(); TcpChannel channel = new TcpChannel(); ChannelServices.RegisterChannel(channel); client = (IHelloRemotingService.IHelloRemtingService)Activator.GetObject( typeof(IHelloRemotingService.IHelloRemtingService), "tcp://localhost:8085/GetMessage"); }
static void Main(string[] args) { TcpChannel channel = new TcpChannel(); ChannelServices.RegisterChannel(channel); client = (IHelloRemotingService.IHelloRemtingService)Activator.GetObject( typeof(IHelloRemotingService.IHelloRemtingService), "tcp://localhost:8080/GetMessage"); Console.WriteLine(client.GetMessage("varuna")); Console.ReadLine(); }