Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Frustrated with Random Numbers - Help :(
#4
Hi ,
You can try if the below mentioned code works for you:

Code:
Dim bytes1(99), bytes2(99) As Byte Dim rnd1 As New Random() Dim rnd2 As New Random() rnd1.NextBytes(bytes1) rnd2.NextBytes(bytes2) Console.WriteLine("First Series:") For ctr As Integer = bytes1.GetLowerBound(0) to bytes1.GetUpperBound(0) Console.Write("{0, 5}", bytes1(ctr)) If (ctr + 1) Mod 10 = 0 Then Console.WriteLine() Next Console.WriteLine() Console.WriteLine("Second Series:") For ctr As Integer = bytes2.GetLowerBound(0) to bytes2.GetUpperBound(0) Console.Write("{0, 5}", bytes2(ctr)) If (ctr + 1) Mod 10 = 0 Then Console.WriteLine() Next ' The example displays the following output to the console: ' First Series: ' 97 129 149 54 22 208 120 105 68 177 ' 113 214 30 172 74 218 116 230 89 18 ' 12 112 130 105 116 180 190 200 187 120 ' 7 198 233 158 58 51 50 170 98 23 ' 21 1 113 74 146 245 34 255 96 24 ' 232 255 23 9 167 240 255 44 194 98 ' 18 175 173 204 169 171 236 127 114 23 ' 167 202 132 65 253 11 254 56 214 127 ' 145 191 104 163 143 7 174 224 247 73 ' 52 6 231 255 5 101 83 165 160 231 ' ' Second Series: ' 97 129 149 54 22 208 120 105 68 177 ' 113 214 30 172 74 218 116 230 89 18 ' 12 112 130 105 116 180 190 200 187 120 ' 7 198 233 158 58 51 50 170 98 23 ' 21 1 113 74 146 245 34 255 96 24 ' 232 255 23 9 167 240 255 44 194 98 ' 18 175 173 204 169 171 236 127 114 23 ' 167 202 132 65 253 11 254 56 214 127 ' 145 191 104 163 143 7 174 224 247 73 ' 52 6 231 255 5 101 83 165 160 231

-Rachna
Reply


Messages In This Thread
RE: Frustrated with Random Numbers - Help :( - by Rachna - 04-02-2009, 11:04 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Get numbers inside all webelements in webtable and sort them pradeep537 1 3,644 08-04-2016, 01:24 AM
Last Post: Ankur
  Create a random number starting with an alphabet QTPmate 4 5,447 07-31-2014, 09:29 AM
Last Post: QTPmate
  Random Values from Drop-Down profqa 5 7,348 12-06-2013, 09:01 AM
Last Post: basanth27
  GCD of N numbers Venkat`s 1 2,736 10-17-2013, 08:58 PM
Last Post: Parke
  Creating Random String SomeIntern 0 5,801 08-21-2013, 09:10 PM
Last Post: SomeIntern

Forum Jump:


Users browsing this thread: 1 Guest(s)