如何为一个空洞指定多个值

本文关键字:空洞 一个 | 更新日期: 2023-09-27 18:20:16

我如何将多个值分配给它所说的位置我需要从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调用,因此您可能需要将更多代码移动到循环中,例如连接到循环中的每个客户端。