Member:
Next (); // obtain 0 .. int. the Int Random Number of maxvalue. The value range is nextbytes (). // 0 .. 255 random number and fill in the byte array nextdouble (); // obtain 0 .. double Random Number of 1
Constructor:
// If no random seed is specified, the system generates the seed protected void button1_click (Object sender, eventargs e) {random r = new random (); int n1 = R. next (); int n2 = R. next (); textbox1.text = string. concat (N1, "\ n", N2);} // the random sequence of the seed value is the same as that of protected void button2_click (Object sender, eventargs E) {random R1 = new random (1); random r2 = new random (1); random R3 = new random (2); byte [] BS1 = new byte [10]; byte [] bs2 = new byte [10]; byte [] bs3 = new byte [10]; r1.nextbytes (BS1); r2.nextbytes (bs2); r3.nextbytes (bs3 ); string S1 = string. join (",", BS1); // 70,208,134,130, 64,151,228,163,149,207 string S2 = string. join (",", bs2); // 70,208,134,130, 64,151,228,163,149,207 string S3 = string. join (",", bs3); // 113,147,198,149, 36,185,227,111,124, 56 textbox1.text = string. concat (S1, "\ n", S2, "\ n", S3 );}
Exercise:
Protected void button1_click (Object sender, eventargs e) {random r = new random (0); int n1 = R. next (); /// 1559595546 int n2 = R. next (10); // 8 int N3 = R. next (1000,200 0); // 1768 textbox1.text = string. concat (N1, "\ n", N2, "\ n", N3);} protected void button2_click (Object sender, eventargs e) {random r = new random (0 ); double F; string STR = ""; for (INT I = 0; I