using System;
using System.Runtime.Remoting;
using System.Runtime.Remoting.Channels;
using System.Runtime.Remoting.Channels.Tcp;
using HelloRemoting;
namespace RemotingSamples {
public class Client
{
public static int Main(string [] args)
{
TcpChannel chan = new TcpChannel();
ChannelServices.RegisterChannel(chan);
SayHello obj =
(SayHello)Activator.GetObject(typeof(SayHello)
, "tcp://localhost:8085/SayHello");
if (obj == null)
System.Console.WriteLine("不能定位到远端服务");
else Console.WriteLine(obj.Hello("你好,我是清江河!"));
return 0;
}
}
}