[DllImport("advapi32.dll", SetLastError=true)]
static extern bool CryptGenRandom(IntPtr hProv, uint dwLen, byte[] pbBuffer);
Declare Function CryptGenRandom Lib "advapi32.dll" (ByVal hProv As IntPtr, ByVal dwLen As Integer, ByVal pbBuffer As Byte()) As Boolean
None.
The RNGCryptoServiceProvider class
None.
Please add some!
byte[] newRandom = new byte[10];
if (!CryptGenRandom(hProv, (uint)(newRandom.Length), newRandom))
{
throw new Win32Exception(Marshal.GetLastWin32Error());
}