C# 如何将多个值指定给一个空

C# 如何将多个值指定给一个空,c#,C#,我如何分配多个值到它所说的uint我需要从0到18,因为我在做基于客户端的事情,需要同时为所有18个客户端完成 RPC.doTypeWriter((uint) 0 , (int)numericUpDown21.Value, metroTextBox22.Text, (short)numericUpDown23.Value, (double)numericUpDown24.Value, (float)numericUpDown25.Value, (float)numericUpDown26.Val

我如何分配多个值到它所说的uint我需要从0到18,因为我在做基于客户端的事情,需要同时为所有18个客户端完成

RPC.doTypeWriter((uint) 0 , (int)numericUpDown21.Value, metroTextBox22.Text, (short)numericUpDown23.Value, (double)numericUpDown24.Value, (float)numericUpDown25.Value, (float)numericUpDown26.Value, (ushort)numericUpDown35.Value, (ushort)numericUpDown36.Value, (ushort)numericUpDown37.Value, (int)numericUpDown27.Value, (int)numericUpDown28.Value, (int)numericUpDown29.Value, (int)numericUpDown30.Value, (int)numericUpDown31.Value, (int)numericUpDown32.Value, (int)numericUpDown33.Value, (int)numericUpDown34.Value);

你不能。
uint
是单个整数值,不能包含多个值

使用循环从0循环到17(即18个客户端):

for(uint i=0;i<18;i++){
RPC.doTypeWriter(i,(int)numericUpDown21.Value,metroTextBox22.Text,(short)numericUpDown23.Value,(double)numericUpDown24.Value,(float)numericUpDown25.Value,(float)numericUpDown26.Value,(ushort)numericUpDown35.Value,(ushort)numericUpDown36.Value,(ushort)numericUpDown37.Value,(int)numericUpDown27.Value,(int)numericUpDown28.Value,(int)numericUpDown29.Value,(int)numericUpDown30.Value,(int)numericUpDown31.Value,(int)numericUpDown32.Value,(int)numericUpDown33.Value,(int)numericUpDown34.Value);
}

命名表明您正在对客户端进行RPC调用,因此您可能需要将更多代码移动到循环中,例如,连接到循环中的每个客户端。

?不能将任何值指定给空,并且uint一次只能有一个值。如果要同时传输多个值,可以使用数组或列表。否则:可能会多次调用该方法(取决于上下文)。我试过多次调用它,但它似乎出了问题。谢谢你,如果我听起来很傻,我很抱歉,只是started@AdamHeapsiMoD1998当前位置我不认为这是愚蠢的,这是一个完全合乎逻辑的解决方案,但事实上这是不可能的。继续跳出框框思考。:)谢谢,哥们,可能是迟来的答复我已经把它做好了非常感谢你的理解
for (uint i = 0; i < 18; i++) {
  RPC.doTypeWriter(i, (int)numericUpDown21.Value, metroTextBox22.Text, (short)numericUpDown23.Value, (double)numericUpDown24.Value, (float)numericUpDown25.Value, (float)numericUpDown26.Value, (ushort)numericUpDown35.Value, (ushort)numericUpDown36.Value, (ushort)numericUpDown37.Value, (int)numericUpDown27.Value, (int)numericUpDown28.Value, (int)numericUpDown29.Value, (int)numericUpDown30.Value, (int)numericUpDown31.Value, (int)numericUpDown32.Value, (int)numericUpDown33.Value, (int)numericUpDown34.Value);
}