编译器错误 CS1593
委托“del”不接受“number”参数
传递给 委托 调用的参数数目与委托声明中的参数数目不一致。
下面的示例生成 CS1593:
// CS1593.cs
using System;
delegate string func(int i); // declare delegate
class a
{
public static void Main()
{
func dt = new func(z);
x(dt);
}
public static string z(int j)
{
Console.WriteLine(j);
return j.ToString();
}
public static void x(func hello)
{
hello(8, 9); // CS1593
// try the following line instead
// hello(8);
}
}