// 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"); IEmployee one = srv.GetEmployeeById(123); Console.WriteLine(one.Id + " " + one.Name + " " + one.Job); List all = srv.GetAllEmployees(); foreach(IEmployee e in all) { Console.WriteLine(e.Id + " " + e.Name + " " + e.Job); } } } }