Why is a duplicate random string generated by C# method
<p>The following method generates a random string with the given length.</p>

<p>When executed twice in a row, the same string is given. Is anybody able to shed any light on why this might be?</p>

<pre><code> public static string GenerateRandomString(int size, bool lowerCase)
        {
            StringBuilder builder = new StringBuilder();
            Random random = new Random();
            char ch;
            for (int i = 0; i &lt; size; i++)
            {
                ch = Convert.ToChar(Convert.ToInt32(Math.Floor(26 * random.NextDouble() + 65)));
                builder.Append(ch);
            }
            if (lowerCase)
                return builder.ToString().ToLower();
            return builder.ToString();
        }
</code></pre>
