问题我有这样的代码: 字符串文本中有与兰德
if (text.Contains("{AVATAR}"))
text = Regex.Replace(text, "{AVATAR}", m => rand_avatars());
public string rand_avatars()
{
string[] text = avatars.ToArray();
Random rand = new Random(DateTime.Now.Millisecond);
return text[rand.Next(text.Length)];
}
一些{} AVATAR但替换出来后我收到来自头像2个相同的字符串。为什么?
我有类似的问题:http://stackoverflow.com/questions/15162048/very-irdird-code-with-random-works-different-when-i-use-breakpoint – Kamil