



(22 ratings)
Here is a simple but powerful one for ASP.
First of all you need to randomize something wich can be done by the command
Randomize.
You could either just ranomize a number out of nothing by just calling Randomize,
but
I the way to create the "most random" number is to use the servers
clock like this:
Randomize Timer
After calling Randomize, the number is stored in a variable called Rnd and
is between
0,0 to 1,0.
Lets say you want to create a function to randomizer a number between 1 and
10.
This code should do it for you:
| Function Random() Randomize Timer intRandomNumber = CLng( ( Rnd * 9 ) + 1 ) Random = intRandomNumber End Function Response.Write(Random()) |
Feel free to post any feedback.
20 Random Tutorials from the same category :
Reading form variables passed in the URL
ASP.NET in Dreamweaver 8
Iterating through Collections In ASP
Randomizer for ASP
DISPLAY DATA FROM DATABASE
ASP.NET 2 Special Purpose Folders
Displaying Server Values In ASP
The Recordset Object
ASP.NET Tutorial - Making image thumbnails
Using Application Variables
The Connection Object
AIM Profile Screenname Viewer as a component of AIM Profile Designs
NEW WAY TO HANDLE VARIABLES
Passing Query Strings In Asp
SQL Access Methods In ASP
Recordset Access Methods
String Functions
Creating Databases
Server-side Scripting
Processing Form Information In ASP













