如果我这样做会出现一些重复...
private const string _chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ123654987";
public string RandomString(int size)
{
var random = new Random((int)DateTime.Now.Ticks);
Thread.Sleep(random.Next(1, 3));
var buffer = new char[size];
for (int i = 0; i < size; i++)
{
buffer[i] = _chars[random.Next(_chars.Length)];
}
return new string(buffer);
}
前100000个请求必须是唯一的,我该如何保证这一点呢?如果可能的话,我不想维护一个列表并对其进行查询...