26991 total geeks with 3514 solutions
Recent challengers:
 Welcome, you are an anonymous user! [register] [login] Get a yourname@osix.net email address 

Articles

GEEK

User's box
Username:
Password:

Forgot password?
New account

Shoutbox
MaxMouse
It's Friday... That's good enough for me!
CodeX
non stop lolz here but thats soon to end thanks to uni, surely the rest of the world is going good?
stabat
how things are going guys? Here... boring...
CodeX
I must be going wrong on the password lengths then, as long as it was done on ECB
MaxMouse
lol... the key is in hex (MD5: of the string "doit" without the "'s) and is in lower case. Maybe i should have submitted this as a challenge!

Donate
Donate and help us fund new challenges
Donate!
Due Date: Aug 31
August Goal: $40.00
Gross: $0.00
Net Balance: $0.00
Left to go: $40.00
Contributors


News Feeds
The Register
Cheapo Firefox OS
mobes to debut in
India ? definitely
not one for
selfie-conscious
u
Google gobbles
Fitbit whiz Gecko
Design to
strengthen those
things that don"t
shift a
Stiffed by
Synolocker
ransomware crims?
Try F-Secure"s
python tool
iPhone owners EARN
MORE THAN YOU says
mobile report
FCC not quite sold
on Comcast TWC
gobble
Galileo, Galileo!
Galileo, Galileo!
Galileo fit to go.
Magnifico
Red Hat: ARM
servers will come
when people crank
out chips like
AMD"s 64-bit
Seattle
Forrester says it"s
time to give up on
physical storage
arrays
Pedals and wheel in
that Google
robo-car or it"s
off the road ? Cali
DMV
YOU SHALL NOT PASS!
Intel, HyTrust
geo-fence wandering
virty servers
Slashdot
Virtual Machine
Brings X86 Linux
Apps To ARMv7
Devices
"MythBusters" Drops
Kari Byron, Grant
Imahara, Tory
Belleci
Google Wants To
Test Driverless
Cars In a
Simulation
Illinois University
Restricts Access To
Social Media,
Online Political
Content
Ask Slashdot: Where
Can I Find Good
Replacement
Batteries?
Finding an ISIS
Training Camp Using
Google Earth
Researchers Hack
Gmail With 92
Percent Success
Rate
A Better Way To
Make
Mind-Controlled
Prosthetic Limbs
A Better Way To
Make
Mind-Controlled
Prosthetic Limbs
When Customer
Dissatisfaction Is
a Tech Business
Model
Article viewer

ASP Function to Produce a random IDs



Written by:dimport
Published by:dimport
Published on:2003-06-21 07:19:46
Topic:ASP
Search OSI about ASP.More articles by dimport.
 viewed 7811 times send this article printer friendly

Digg this!
    Rate this article :
This nice little function will return a nice little random string which I use to create ID's for ALL my projects, in any language (just got to edit it). In all the time I have used this sub it has NEVER created the same string twice, and if your not happy with it, just call it twice and then it will half the chances again :D


 
'==============================
'============= CODE ============
'==============================

<%
Function Cript()

    Dim strLetters, g, i

    strLetters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
    Randomize Timer
        i = Int(Rnd * 62) + 1
        g = Mid(strLetters, i, 1)
    Cript = Int(Rnd * 999999) + 1 & g

End Function
%>

'==============================
'============= END ============
'==============================

How To Use IT :
 
<% @LANGUAGE=VBScript %>
<% Option Explicit %>
<!-- #Include file="Functions.asp" -->
<%
Dim Cript_String

Cript_String = Cript

Response.Write(Cript_String)

%>


This article was originally written by Cadey

Did you like this article? There are hundreds more.

Comments:
<none>
Anonymously add a comment: (or register here)
(registration is really fast and we send you no spam)
BB Code is enabled.
Captcha Number:



     
Your Ad Here
 
Copyright Open Source Institute, 2006