static void Main(string[] args) { String filename = AppDomain.CurrentDomain.SetupInformation.ConfigurationFile; RemotingConfiguration.Configure(filename); IRemoteCustomerManager mgr = (IRemoteCustomerManager)RemotingHelper.CreateProxy(typeof(IRemoteCustomerManager)); Console.WriteLine("Client.Main(): Reference to rem.obj. acquired"); Customer cust = mgr.GetCustomer(42); Console.WriteLine("Retrieved customer {0} {1}", cust.FirstName, cust.LastName); Console.ReadLine(); }
static void Main(string[] args) { String filename = AppDomain.CurrentDomain.SetupInformation.ConfigurationFile; RemotingConfiguration.Configure(filename); if (args.Length > 0 && args[0].ToLower() == "/enablelog") { LogSettingContext.EnableLog = true; } IRemoteCustomerManager mgr = (IRemoteCustomerManager)RemotingHelper.CreateProxy(typeof(IRemoteCustomerManager)); Customer cust = mgr.GetCustomer(42); Console.WriteLine("Done"); Console.ReadLine(); }
static void Main(string[] args) { String filename = AppDomain.CurrentDomain.SetupInformation.ConfigurationFile; RemotingConfiguration.Configure(filename); IRemoteCustomerManager mgr = (IRemoteCustomerManager)RemotingHelper.CreateProxy(typeof(IRemoteCustomerManager)); Console.WriteLine("Client.Main(): Reference to CustomerManager acquired"); Customer cust = mgr.GetCustomer(4711); int age = cust.GetAge(); Console.WriteLine("Client.Main(): Customer {0} {1} is {2} years old.", cust.FirstName, cust.LastName, age); Console.ReadLine(); }