C#根据长度创建数组
根据长度创建数组;
byte j = 0x00; List<byte> iList = new List<byte>(); for (int i = 0; i < 18; i++) { Random rd = new Random(); do { j = rd.Next(1, 11); } while (iList.Contains(j)); iList.Add(j); } result = master.WriteMultiReg(Address, iList.ToArray());