Results 1 to 2 of 2

Thread: Simple File Referencing

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 2003
    Posts
    4

    Question Simple File Referencing

    i worked it out, you can delete this post. sorry
    Last edited by libster; Jan 1st, 2004 at 11:01 AM.

  2. #2
    Frenzied Member Mike Hildner's Avatar
    Join Date
    Jul 2002
    Location
    Des Moines, NM
    Posts
    1,690
    How about using the Random class? Might be other ways to do as well.

    VB Code:
    1. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    2.         Dim names() As String = {"Anna", "Jim", "Claire", "Rob"}
    3.         Dim random As New Random(Now.Second) ' Or some other seed
    4.  
    5.         Dim i As Integer
    6.         i = random.Next(names.GetLowerBound(0), names.GetUpperBound(0))
    7.         TextBox1.Text = names(i)
    8.     End Sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width