hello.cs

来自「Professional C# 2nd Edition」· CS 代码 · 共 37 行

CS
37
字号
using System;
using System.Runtime.Remoting.Messaging;

namespace Wrox.ProfessionalCSharp
{
	/// <summary>
	/// Summary description for Class1.
	/// </summary>
	public class Hello : System.MarshalByRefObject
	{
		public Hello()
		{
			Console.WriteLine("Constructor called");
		}

		~Hello()
		{
			Console.WriteLine("Destructor called");
		}

		public string Greeting(string name)
		{
			Console.WriteLine("Greeting called");
         System.Threading.Thread.Sleep(10000);
			return "Hello, " + name;
		}

      [OneWay]
      public void TakeAWhile(int ms)
      {
         Console.WriteLine("TakeAWhile started");
         System.Threading.Thread.Sleep(ms);
         Console.WriteLine("TakeAWhile finished");
      }
	}
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?