欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

C#生成隨機(jī)字符串的實(shí)例

 更新時(shí)間:2013年03月06日 11:23:42   作者:  
本文介紹了“C#生成隨機(jī)字符串的實(shí)例”,需要的朋友可以參考一下
復(fù)制代碼 代碼如下:

/// <summary> 
 /// 生成隨機(jī)字符串 
 /// </summary> 
 private class RandomStringGenerator 
 { 
     static readonly Random r = new Random(); 
     const string _chars = "0123456789"; 
     public static string GetRandomString() 
     { 
         char[] buffer = new char[5]; 
         for (int i = 0; i < 5; i++) 
         { 
             buffer[i] = _chars[r.Next(_chars.Length)]; 
          } 
          return new string(buffer); 
      } 
 }

相關(guān)文章

最新評(píng)論