List<string> lstSample = new List<string>();              
                Random rand = new Random();
                List<int> lstRand = new List<int>();
                for (int i = 0; lstRand.Count() < sampleNum; i++)
                {
                    int mRandNum = rand.Next(0, mStageDataCount);
                    if (!lstRand.Contains(mRandNum))
                    {
                        lstRand.Add(mRandNum);
                        lstSample.Add(lstDataAll.ToList()[mRandNum]);
                    }
                }  
View Code

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-11-22
  • 2021-10-04
  • 2022-01-11
  • 2022-03-02
  • 2021-12-09
  • 2022-12-23
猜你喜欢
  • 2021-07-29
  • 2022-12-23
  • 2021-11-28
  • 2022-12-23
  • 2022-12-23
  • 2021-10-04
  • 2021-11-22
相关资源
相似解决方案