예제 #1
0
        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"));
            }
        }
예제 #2
0
        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"));
            }
        }
예제 #3
0
파일: Hello.cs 프로젝트: taozididi/example
        public string Greeting(string name)
        {
            Console.WriteLine("Greeting called");

            CallContextData cookie =
                (CallContextData)CallContext.GetData("mycookie");

            if (cookie != null)
            {
                Console.WriteLine("Cookie: " + cookie.Data);
            }

            return("Hello, " + name);
        }