Hello.cs
上传用户:lxycoco
上传日期:2022-07-21
资源大小:38457k
文件大小:1k
- using System;
- using System.Runtime.Remoting.Messaging;
- namespace Wrox.ProCSharp.Remoting
- {
- public class Hello : System.MarshalByRefObject
- {
- public Hello()
- {
- Console.WriteLine("Constructor called");
- }
- public string Greeting(string name)
- {
- Console.WriteLine("Greeting started");
- CallContextData cookie =
- (CallContextData)CallContext.GetData("mycookie");
- if (cookie != null)
- {
- Console.WriteLine("Cookie: " + cookie.Data);
- }
- Console.WriteLine("Greeting finished");
- return "Hello, " + name;
- }
- }
- }