I’d like to know a good way to generate several megabytes of random data using C# on Windows (using .NET 2.0 for deployment, but other approaches using other options such as .NET 3.0 and Mono libraries would also be of some interest).
The purpose of the data is to transmit over a network connection, to evaluate real world network throughput to fixed destinations, so the level of randomness is not really significant – though the data itself should not be something trivially compressible (such as simple series of repeating characters).
I can use Random, or generate GUID’s but I’m curious to know if there are better ways of doing this. Is there something analogous to /dev/urandom on UNIX for example?
You can use this approach to generate random numbers stream: