using System;
using System.Runtime.Remoting;
using System.Runtime.Remoting.Channels;
using System.Runtime.Remoting.Channels.Tcp;
using RemoteSample;
namespace Client
{
class RemoteClient
{
static void Main(string[] args)
{
//客户端:1.注册通道 2.获得远程对象
//1.注册通道
ChannelServices.RegisterChannel(new TcpClientChannel(), false);//向信道服务注册一个客户端的Tcp信道
//2.获得远程对象 WellKnown激活模式
RemoteSample.RemoteObject remoteobj = (RemoteSample.RemoteObject)Activator.GetObject(typeof(RemoteObject), "tcp://localhost:8080/RemoteObject");//获取对现有远程对象的引用,为指定类型和URL所指示的已知对象创建一个代理
while (true)
{
Console.WriteLine("请输入a,b:");
int a=C