码迷,mamicode.com
首页 > 编程语言 > 详细

c#不重复的排序方法

时间:2015-12-09 11:34:29      阅读:210      评论:0      收藏:0      [点我收藏+]

标签:

      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;
        }

  

c#不重复的排序方法

标签:

原文地址:http://www.cnblogs.com/muxueyuan/p/5031985.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!