Sythe.Org Forums     Register     FAQ     Members List     Calendar     Mark Forums Read    
 
Sythe.Org Forums  
   Runescape Gold

Sythe.org — A Virtual Goods Trading Hub

Make real cash! buying and selling in-game items.

We have a no-scam policy.

You can make thousands playing your favourite games here at Sythe.org.

Just sign up an account and follow the rules!


Take me to

Runescape Markets

Other Game Markets

Support Center

Register an Account

Close
How to generate random numbers and letters (help)
Reply
 
LinkBack Thread Tools Display Modes
  #1  
Old 02-05-2011, 07:09 AM
w000t's Avatar
Grand Master
$5 USD Donor
 
Join Date: Jan 2007
Location: GFX section.
Posts: 2,600
Send a message via MSN to w000t
Default How to generate random numbers and letters (help)

Well I've begun working on my first VB.net program its a password genorator all it does is generates a random sequence for a password and i cant seem to figure out how to get it to generate random numbers and letters. Any help is appreciated.
__________________

^^Click for 50+ vouches^^
Reply With Quote
  #2  
Old 02-06-2011, 03:49 AM
Newcomer
 
Join Date: Feb 2011
Posts: 4
Send a message via MSN to NullzHost
Default Re: How to generate random numbers and letters (help)

First implment this code in your form:
Code:
    Private Function RandomNumberAsString(ByVal Min As Int32, ByVal Max As Int32) As String
        Return (New Random).Next(Min, Max).ToString
    End Function
Then when a user clicks Button1 or whatever put this code for it.
Code:
TextBox1.Text = Me.RandomNumberAsString(1000, 999999)
This will randomly generate a number between 1000 and 999999, change it as needed.
Reply With Quote
  #3  
Old 02-10-2011, 01:49 PM
Active Member
SELF-REQUESTED BAN
 
Join Date: Feb 2011
Location: Australia
Posts: 230
Default Re: How to generate random numbers and letters (help)

Quote:
Public Function Gen_Rand_Password(PassLength As Integer) As String

Dim RetVal As String

Dim Max As Integer

Dim Min As Integer

Max = 126

Min = 48

Randomize Timer


If PassLength < 8 Then

Gen_Rand_Password = "error: invalid length"

End If


For I = 1 To PassLength

RetVal = RetVal & Chr(Int((Max - Min + 1) * Rnd + Min))

Next I

Gen_Rand_Password = RetVal

End Function

RandomPassword = Gen_Rand_Password(8)
Code is set to the standard length of eight. Shoot me a PM if you're unable to apply.

If your not 100% with you "for loops" then look at this tutorial: http://www.youtube.com/watch?v=aM_5FWRk23c

It's fairly basic but you get the idea.
Reply With Quote
Reply



Cheap RS Gold Store  Runescape Gold

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

All times are GMT +1. The time now is 04:22 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.6.1