Quantcast

Maximum PC

It is currently Fri Oct 31, 2014 5:40 am

All times are UTC - 8 hours




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: vb.net code to generate random statements in textbox: help
PostPosted: Mon Mar 14, 2005 4:30 pm 
8086
8086

Joined: Wed Dec 08, 2004 3:24 pm
Posts: 12
Hi does anyone in here know how to make a peice of code in vb.net attach to
a random number generator to generate text withing the textbox randomly.
for example creating a program similar to "who want to be a millionaire" where the statements are present without putting them into a database nor nothing and generating them randomly with the use of the random method in vb.net.


Top
  Profile  
 
 Post subject:
PostPosted: Mon Mar 14, 2005 8:03 pm 
Million Club - 5 Plus*
Million Club - 5 Plus*
User avatar

Joined: Sun Sep 12, 2004 6:37 pm
Posts: 4745
Location: In the monkey's litterbox
Here is a sample function that builds a random number using pure .NET
Code:
    Friend Function generateRequestID() As String
        'Generates an 8 digit request id
        Dim sRID As String
        Dim rNumGen As New Random
        Do
            Dim x As Integer
            sRID = String.Empty
            x = 0
            For x = 0 To 7
                sRID = sRID & CStr(rNumGen.Next(0, 9))
            Next
        Loop Until dbCheckRequestID(sRID) = True
        'Check to make sure it is valid
        Return sRID
    End Function


Top
  Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 8 hours


Who is online

Users browsing this forum: No registered users and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group

© 2014 Future US, Inc. All rights reserved.