class1.cs

来自「C#开发教程 由浅入深 配有实例 是初学者的好帮手」· CS 代码 · 共 38 行

CS
38
字号
using System;

namespace ColorByVal
{
	class Color
	{
		public Color()
		{
			this.red = 0;
			this.green = 127;
			this.blue = 255;
		}

		protected int red;
		protected int green;
		protected int blue;

		public int GetRed() { return this.red; }
		public int GetGreen() { return this.green; }
		public int GetBlue() { return this.blue; }
	}

	class Class1
	{
		[STAThread]
		static void Main(string[] args)
		{
			Color c = new Color();
			int red = c.GetRed();
			int green = c.GetGreen();
			int blue = c.GetBlue();

			Console.WriteLine("R={0}, G={1}, B={2}",
				red, green, blue);
		}
	}
}

⌨️ 快捷键说明

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