请以事件的概念实现: 控制台屏幕录入任意字符串,并回显 "你键入了:" + 你刚才键入的字符串,如果键入 "q",退出程序,运行结束!
*/
/*
class Class1
{
public delegate void FireEventHandler(string s);
public static event FireEventHandler FireStatic;
static bool b = false;
static void Main(string[] args)
{
FireStatic += new FireEventHandler(Fire1);
System.Console.WriteLine("请键入任意字符(串),""q"" 退出!");
string s;
while (true)
{
s = System.Console.ReadLine();
FireStatic(s);
if (b == true)
break;
}
}
static void Fire1(string s)
{
if (s != "q")
{
System.Console.WriteLine("你键入了: " + s);
}
else
{
System.Console.WriteLine("不送了!");
b = true;
}
}
}
*/
/*
浙公网安备 33010602011771号