 <pre><code>private static Random random = new Random((int)DateTime.Now.Ticks);//thanks to McAden public long LongBetween(long maxValue, long minValue) { return (long)Math.Round(random.NextDouble() * (maxValue - minValue - 1)) + minValue; } </code></pre>