c#不重复的排序方法

      public int getRandom(int num)
        {
            Thread.Sleep(5);
           // Random ro = new Random(unchecked((int)DateTime.Now.Ticks));
            Random ro = new Random(System.Guid.NewGuid().GetHashCode());
            
            int iResult;
            int iUp = num+1;
            int iDown = 1;
            iResult = ro.Next(iDown, iUp);
            return iResult;
        }

        public int getRandom(int down,int num)
        {
            Thread.Sleep(5);
            //Random ro = new Random(unchecked((int)DateTime.Now.Ticks));
            Random ro = new Random(System.Guid.NewGuid().GetHashCode());
            int iResult;
            int iUp = num + 1;
            int iDown = down;
            iResult = ro.Next(iDown, iUp);
            return iResult;
        }

  

posted on 2015-12-09 10:14  雪原日暮  阅读(432)  评论(0编辑  收藏  举报