// Collection of code snippets by Arne Vajhøj // (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) using System; using System.Collections.Generic; using System.Runtime.Remoting; using System.Runtime.Remoting.Channels; using System.Runtime.Remoting.Channels.Tcp; using Demo.Common; namespace Demo.Client { public class ClientMain { public static void Main(string[] args) { ChannelServices.RegisterChannel(new TcpClientChannel(), true); IEmployeeService srv = (IEmployeeService)Activator.GetObject(typeof(IEmployeeService), "tcp://localhost:40000/EmployeeService"); Employee one = srv.GetEmployeeById(123); Console.WriteLine(one); List all = srv.GetAllEmployees(); foreach(Employee e in all) { Console.WriteLine(e); } } } }