当参数超过5个时,建议用结构来传递多个参数。 示例代码如下: 复制代码 public struct MyStruct { public string str; public int number; } class Program { static void Main(string[] args) { MyStruct myStruct = new MyStruct(); myStruct.str = "Number :"; myStruct.number = 100; MyClass mc = new MyClass(); mc.output(myStruct); Console.ReadKey(); } } class MyClass { public void output(MyStruct ms) { Console.WriteLine(ms.str + ms.number.ToString()); } } 复制代码