Thread Rating:
  • 2 Vote(s) - 4 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Tut] Generating Random Strings (200 Random Results = LIMIT) [Tut]
#3
(03-21-2011, 06:02 AM)z3r0c00l Wrote: Can you put a code that Adds a Case With a Random Name entered by the user?

Yes definitely, it would be like this:

ButtonX.Click()
TextBox1.Text = My.Settings.*NameOfString*
My.Settings.Save()

To allow custom values with My.Settings and if you would want a in depth tutorial on that stuff, go to my tutorial on My.Settings."WhateverString", CLICK HERE

Then you could make the program have a code like this:

Code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim Key As Integer
        Key = Int(Rnd() * 5) 'The number 5 is replaced with the Maximum number of cases you have created.
        Select Key
            Case 0
                TextBox1.Text = My.Settings.*NameOfString0*
            Case 1
                TextBox1.Text = My.Settings.*NameOfString1*
            Case 2
                TextBox1.Text = My.Settings.*NameOfString2*
            Case 3
                TextBox1.Text = My.Settings.*NameOfString3*
            Case 4
                TextBox1.Text = My.Settings.*NameOfString4*
            Case 5
                TextBox1.Text = My.Settings.*NameOfString5*
        End Select
    End Sub

So basically what this code I have written for you is allowing the user to set a value for a string like you said, then it would find the strings value (what the user typed) at random and generate it into TextBox2, because TextBox1 is already being occupied at the moment.
[Image: t5BWm.png]
Reply


Messages In This Thread
RE: [Tut] Generating Random Strings (200 Random Results = LIMIT) [Tut] - by Resistance - 03-21-2011, 06:21 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How to hook the keyboard. [VB.NET] [TuT] Vorfin 92 57,145 09-23-2019, 11:55 AM
Last Post: Jamimartin
  [TUT]Creating Advanced Web Browser with Awesome Theme Imaking31 0 1,320 05-25-2013, 03:12 AM
Last Post: Imaking31
  VB.NET Port Scanner [TUT] Fragma 30 13,150 11-27-2012, 11:26 PM
Last Post: ƃu∀ ıʞƃu∀
  [TUT] MD5 Encrypter & Finder [VB.NET] Fragma 12 7,236 11-25-2012, 10:36 PM
Last Post: ƃu∀ ıʞƃu∀
  [TUT] How to make a simple WebBrowser in VB 2010! [TUT] - [ Pictures] Statics 95 57,255 10-07-2012, 06:56 AM
Last Post: a99

Forum Jump:


Users browsing this thread: 5 Guest(s)