using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Interfaces;
using System.Runtime.Remoting;
using System.Runtime.Remoting.Activation;
using System.Runtime.Remoting.Channels;
namespace Client
{
class Program
{
static void Main(string[] args)
{
System.Runtime.Remoting.Channels.Tcp.TcpClientChannel channel = new System.Runtime.Remoting.Channels.Tcp.TcpClientChannel();
ChannelServices.RegisterChannel(channel, false);
ICustomer cust = (ICustomer)Activator.GetObject(typeof(ICustomer), "tcp://localhost:8080/customer");
//ICustomer cust = (ICustomer)Activator.CreateInstance(typeof(ICustomer), null, new object[] {new UrlAttribute("tcp://localhost:8080")} );
RemotingConfiguration.RegisterActivatedClientType(typeof(ICustomer), "tcp://localhost:8080/remoteserver");
//ICustomer cust = n
Console.WriteLine("Name: " + cust.getName());
Console.Read();
}
}
}
|