HelloClient.cs
上传用户:lxycoco
上传日期:2022-07-21
资源大小:38457k
文件大小:1k
- using System;
- using System.Runtime.Remoting.Channels;
- using System.Runtime.Remoting.Channels.Tcp;
- using System.Runtime.Remoting.Channels.Http;
- using System.Runtime.Remoting;
- using System.Runtime.Remoting.Activation;
- using System.Runtime.Remoting.Lifetime;
- using System.Runtime.Remoting.Messaging;
- namespace Wrox.ProCSharp.Remoting
- {
- public class HelloClient
- {
- public static void Main(string[] args)
- {
- RemotingConfiguration.Configure("HelloClient.exe.config");
- Hello obj = new Hello();
- if (obj == null)
- {
- Console.WriteLine("could not locate server");
- return;
- }
- CallContextData cookie = new CallContextData();
- cookie.Data = "information for the server";
- CallContext.SetData("mycookie", cookie);
- for (int i=0; i < 5; i++)
- {
- Console.WriteLine(obj.Greeting("Christian"));
- }
- for (int i=0; i < 5; i++)
- {
- Console.WriteLine(obj.Greeting("Christian"));
- }
- }
- }
- }