RandomNumberGenerator.GetBytes メソッド
アセンブリ: mscorlib (mscorlib.dll 内)



100 バイト長のランダム シーケンスを作成し、random に格納する例を次に示します。
Dim random() As Byte = New Byte(100) {} 'RNGCryptoServiceProvider is an implementation of an RNG Dim rng As New RNGCryptoServiceProvider() rng.GetBytes(random) ' bytes in random are now random
byte[] random = new Byte[100]; //RNGCryptoServiceProvider is an implementation of a random number generator. RNGCryptoServiceProvider rng = new RNGCryptoServiceProvider(); rng.GetBytes(random); // The array is now filled with cryptographically strong random bytes.

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


RandomNumberGenerator クラス
RandomNumberGenerator メンバ
System.Security.Cryptography 名前空間
その他の技術情報
暗号サービス
Weblioに収録されているすべての辞書からRandomNumberGenerator.GetBytes メソッドを検索する場合は、下記のリンクをクリックしてください。

- RandomNumberGenerator.GetBytes メソッドのページへのリンク