26998 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
timsattemme
<strong><a href="http:/ /www.timberl andoutletco. com/">timber land boot outlet</a></ strong> <br> <strong><a href="http:/ /www.timberl andoutletco. com/">timber land outlet</a></ strong> <br> <strong><a href="http:/ /www.timberl andoutletco. com/">timber land shoes</a
timsattemme
[b][url=http ://www.tiffa nymotorsale. com/]sterlin g silver tiffany[/url ][/b] [b]<a href="http:/ /www.tiffany motorsale.co m/">tiffany outlet store</a>[/b ] ant pain of fibromyalgia and / or arthritis, can be quick in order to disagree. At present, many skille
timsattemme
[b][url=http ://www.faker eplicaomega. com/]rep<str ong><a href="http:/ /www.fakerep licaomega.co m/">replica watch</a></s trong> <br> <strong><a href="http:/ /www.fakerep licaomega.co m/">replica watches</a>< /strong> <br >
timsattemme
<ul><li><str ong><a href="http:/ /www.copyfak ewatches.com /">omega watches</a>< /strong> </l i><li><stron g><a href="http:/ /www.copyfak ewatches.com /">watches</ a></strong> </li><li><st rong><a href="http:/ /www.copyfak ewatches.com /">new style watches</a>< /strong>
MaxMouse
It's Friday... That's good enough for me!

Donate
Donate and help us fund new challenges
Donate!
Due Date: Sep 30
September Goal: $40.00
Gross: $0.00
Net Balance: $0.00
Left to go: $40.00
Contributors


News Feeds
The Register
Security rEsrchRs
find nu way 2 spot
TXT spam
SHARE "N" SINK:
OneDrive corrupting
Office 2013 files
Singapore slings
18k fine at
text-spam-spaffing
biz owner
Apple, FBI probe
nude celeb hacks
South Korea"s top
wireless carrier
builds Internet of
Eels
Microsoft changes
cert test
providers, hints at
fun new exams
Epiphany hits
Raspberry Pi
founders, users
Sex-in-space geckos
killed by frigidity
Transparency by
Telstra: a good
start but not
enough
Cisco climbs aboard
containerisation
cloudwagon, with
security
reservations
Slashdot
Finland"s Nuclear
Plant Start Delayed
Again
Ask Slashdot:
Linux-Friendly
Desktop x86
Motherboard
Manufacturers?
Hidden Obstacles
For Delivery Drones
Hackers Behind
Biggest-Ever
Password Theft
Begin Attacks
Tox, a Skype
Replacement Built
On "Privacy First"
Net Neutrality
Campaign To Show
What the Web Would
Be Like With a
"Slow Lane"
New Computer Model
Predicts Impact of
Yellowstone Volcano
Eruption
Raspberry Pi Gets a
Brand New Browser
Power Grids: The
Huge Battery Market
You Never Knew
Existed
Radioactive Wild
Boars Still Roaming
the Forests of
Germany
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 7823 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