c# random number between 0 and 1

C#
Random rand = new Random();
return rand.NextDouble; //returns a random number bw 0.0 and 1.0!
Source

Also in C#: