Random r=new Random();
r.NextDouble()返回一个介于0和1之间的小数

解决方案 »

  1.   

    返回正随机数。
    [C#] public virtual int Next();
    返回一个小于所指定最大值的正随机数。
    [C#] public virtual int Next(int);
    返回一个指定范围内的随机数。
    [C#] public virtual int Next(int, int);
      

  2.   

    System.Random,自己看MSDN好了,非常简单~
      

  3.   

    http://xml.sz.luohuedu.net/xml/ShowDetail.asp?id=974D970D-0203-4a77-8BA3-D6EB98E2FC59
      

  4.   

    看ms-help://MS.VSCC/MS.MSDNVS.2052/cpref/html/frlrfsystemrandommemberstopic.htm
      

  5.   

    ms-help://MS.VSCC.2003/MS.MSDNQTR.2003FEB.2052/cpref/html/frlrfsystemrandommemberstopic.htm
      

  6.   

    public static string GetNumberRandom()
    {
    int intNum;
    long lngNum;
    string strNum = System.DateTime.Now.ToString();
    strNum = strNum.Replace(":","");
    strNum = strNum.Replace("-","");
    strNum = strNum.Replace(" ","");
    lngNum = long.Parse(strNum);
    System.Random objDom = new Random();
    intNum = objDom.Next(1000000,9999999);
    objDom = null;
               
    lngNum += intNum;
    return lngNum.ToString();
    }