編譯器錯誤 CS0231
更新:2007 年 11 月
錯誤訊息
params 參數在型式參數清單中必須是最後一個。
params 參數支援多個引數,且必須放在其他所有參數之後。如需詳細資訊,請參閱方法 (C# 程式設計手冊)。
下列範例會產生 CS0231:
// CS0231.cs
class Test
{
public void TestMethod(params int[] p, int i) {} // CS0231
// To resolve the error, use the following line instead:
// public void TestMethod(int i, params int[] p) {}
static void Main()
{
}
}