Random GUID Type Number Or RegExp

I have used:

set typ = server.createobject("Scriptlet.TypeLib")

to create a random string of 36 characters. However, is there a way to
create a random string of digits in the length I request? Perhaps a string
of 20 digits with a few asterisks thrown in for ease of typing?

for example:
4515-81301-75454-45136-1

Would this be reated with RegExp? And how?

View Replies


ADVERTISEMENT

Random Number Not Random

I am trying to generate a random number. I am using randomize and then rnd to return a decimal number between 100 and 120. This will give me a longitude. I am doing something similar to generate a latitude.

I created this on a page which refreshs every minute. I put these points into a map and they are showing up in groups of straight lines. Since rnd is time based will refreshing every 60 seconds return similar numbers?

View Replies View Related

Random Number

trying to get a random number from 0000 to 9999, is there an easy way to do this? i'm using this for a unique filename and want it to be 4 digits from 0000 to 9999.

View Replies View Related

Random Number

x = ROUND((0.9+1.005*RND()-0.4),1)
y = INT(y * x)

This is what I'm trying to acheive:
- "Y" has a preset value between 1-100
- "X" should be random between 0.8 and 1.2
- "X * Y" is the final value of "Y" as a whole number

What I'm struggling with is getting the value of X to be random between 0.8 and 1.2....

View Replies View Related

Random Number

How would you go changing a random number generated into a item drawn from a database with SQL....

View Replies View Related

Random Number

I need to create a random number, or even better, and random combination of letters and numbers, to be used as a type of security key for changing a user's password on this site i'm working on. Basically, the user fills out this form which sends them and e-mail w/ instructions on how to change their password (pretty basic, lots of sites do it).

In the e-mail of course is a link which links to a page with querystring values that include their customer number, the action (reset password), and hopefully this "key." What I'd like to do is have the key written to a database when the e-mail is sent and then deleted when the password is changed. So, how can I generate this key. I think I can take care of the writing to/deleting from the database.

View Replies View Related

Random Number Problem

I'm trying to create a random number that has to solid letters at the beginning followed by 8 random numbers (DN13523781) This number also can't be in use alreaddy which means it can't alreaddy be in a colum called number in the database.

I can do the letters followed by one number, but I can't figure out how to get 8 numbers in a row without getting the same ones over and over(88888888)

I also don't know how to check if it's alreaddy used in the database.

Also does someone know how I can prevent the same number from being produced before it can be added to the database at an other location/pc.

I'm building an online store and I want to give people an order number when they order something. Code:

View Replies View Related

Random Number Function

Does anyone know of any parameters for either of these functions?
Say, if I wanted only numbers between 1 and 100?
Code:

<%
randomize()
response.write(rnd())
%>

View Replies View Related

Unique Random Number

How can I generate a unique random number?

View Replies View Related

0.7055475 Is Not A Random Number!

I've got a realy wierd server problem - everytime i ask for a random number using rnd() i get 0.7055475. This problem just appeared the other day. I hadnt changed any server or os settings, however i have recently recieved a 6 part xp pro update... - has anybody come accross this before?

View Replies View Related

Generate Random Number Between 1 & 5

I want to display a random banner from a selection of 5 banners. So if number = 1 then display baner 1 etc. My code is as follows:

bannerCount = bannerRecordSet.RecordCount
Dim bannerSelected
Randomize
bannerSelected = Int(Rnd * bannerCount)

The above code works although it never seems to generate the value 1, ie 2-5. Also when I refresh the page sometimes a random banner is displayed and other times I get an error. Is this because I am generating a value outside 1-5? Code:

View Replies View Related

ASP Random Number Generator?

Does anyone know how to code in a very simple random number generator?

Basically, my ASP site is linked to an SQL d/base. What I want to do is have a "Random quote of the day"... the R.N.G. should spit out a number, and that number references the random_quote_ID in the d/base and spits it out.

View Replies View Related

Assign A Random Number

I have this simple application that I put together using ASP. It has an html form that submits to an access database through a simple ASP file. It’s a survey form basically. One of the departments here wants to get some feedback from their students and in return for filling out the survey they will be entered into a drawing for a gift certificate. The catch is that the survey is anonymous. What they want to happen is each person is given a unique number at the end of the survey and they will pick one of those numbers randomly to see who the winner is. How can I possibly do this? I am stuck.

I think I may know what I need to do:

Pull a unique number from a database and post it onto the HTML form near the submit button. Notate on the page that the user write the number down and when they hit submit it is inserted into the database along with the record. I have absolutely no idea how to do that.

The HTML form submits into the database using this "add.asp" file:

Code: ....

View Replies View Related

Generating Random Number...

I've tried using javascript to rotate an image upon reload, but I can't get it working, so now I'm trying it with asp. I don't understand why this won't work. Any ideas? Code:

View Replies View Related

Random Number Generation

I want to create a random number where it concatenates with the "day counter" as explained below and name of the person inorder to generate a unique id.

by day counter i mean. there are 365 days in a year and today is the 18th day of the yeat. so the counter generated shud be 18&Smilesmita. How do i do this in ASP ?

View Replies View Related

Generate Random Number

I know this is not a php forum, but i've been given a task to create a form that requires a unique number every time the form is loaded. The form has been created but they have php on their site. windows would be in 3 weeks time but they want the form asap. The field is a hidden field since i've never looked at a php code page b4 i need some help.

View Replies View Related

Test A Random Number For Nearby Numbers

not after code, just thoughts, suppose i'm generating a random 8-digit pin number for our clients, first i'll be checking against the db to see if it already exists before assigning it. what i might do for that is getstring all of the exsiting pins at the top of the script and just keep performing an instr until i get a 0. (i dont expect to ever go above a thousand clients for this system and hopefully my initial number will be random enough that these checks are for backup/redundancy assertion anyway)

but anyway, the main problem is: i dont want to generate a random pin that is one (or maybe two) digit(s) different from another,. i.e.

11111111 is too close to 14115111 and much too close to 11111811. 11121111 is right out of the question as it can be entered as a typo, as is 11111411 because of the numpad

so i'm after thoughts on how to perform that check, i suppose if i went with the "big string of all pins that went before" check i could perform a number of regex searches on the string. i.e.

my pin is 12345678 and i dont want ony to be one digit different so i'd check the string against .2345678 1.345678 12.45678 and so on. think i just answered my own question, anyone else got any ideas? especially for the two digit case (dont want to be performing 36 regex checks do i!)

View Replies View Related

GUID

how would i figure out what the GUID for .pdf Titles would be?
right now I'm using an asp script to return file information. I can get the file title if the file is a .doc type....but not if it's a .pdf type, even though a title is present in the properties. I can however get the .pdf file name as it's stored in the directory...just not the Title.

View Replies View Related

How To Generate A GUID Value In ASP

Can you tell me how to generate a GUID value in ASP?

View Replies View Related

How Get The GUID Automaticly?

How get the GUID automaticly? I will Creates a Genuinely Unique Identification Number (GUID) of type, like {XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}.

View Replies View Related

GUID Across A DB Table

If someone registering for the site, enters their GUID. Now a check is made on that GUID across a DB Table to see if the GUID is present. There are approx 57,000 GUIDS in said table. It is msSQL DB on windows server 2000 server, how long would that check take?

I know there are several variables that come into play here, but I am looking for a ball park figure on how long it would and should take.

View Replies View Related

GUID Values Repeating

I have been creating new GUID's through this block of code

set typ = server.createobject("Scriptlet.TypeLib")
guid = TRIM(MID(cstr(typ.GUID),2,36))
Response.Cookies("guid") = guid
Response.Cookies("guid").path = "/"
Response.Cookies("guid").expires = now() + 1
set typ = nothing

Lateley, some visitors to the website are actually receiving the same guid.How is this possible? Is there a process that may be used to reset the guid delevery sysem?

View Replies View Related

I Am Using A GUID (Global Unique ID) In Asp And Need To Know How It Works

I am using a GUID in asp e.g

i_GUID=(left(createObject("scriptlet.typelib")).guid,38)

and need to find out how reliable it is and how it generates a unique ID.

an example of the unique ID is {FEE7EECD-2E70-4E95-8EE1-C887B34EBB3E}

can anyone point me in the right direction for documentation on how this is generated.

View Replies View Related

Dynamically Generating GUID Online And Then Using Them In VB.NET How Might I Do This?

first, say I have a payment processing scheme, and after a value is returned letting the program know that a sucessful payment is made, that somehow I dynamically create a GUID, (or something of the like). I want to have it somehow embedded in the program as well as well as sent to the buyer so that he can enter in that GUID and it unlocks the program.

So somehow I want to generate a GUID, either inside the program or outside of it which either way is incorperated into the program, and so that I have a copy of it. I want this all to be able to be done dynamically and I assume it would have to be done in ASP.NET as it doesen't seem feasable to run a .exe program on the web.

Any leads? Or perhaps there is some sort of "shell" that I can embed my program in that will do this for me. Any ideas?

View Replies View Related

Call To Guid Property Of Scriptlet.TypeLib Times Out

I use following code in an ASP page to generate a GUID:

<%
dim obj
Set obj = Server.CreateObject("Scriptlet.TypeLib")
Response.Write(obj.guid)
Set obj = nothing

%>

It worked fine on my WIN2000 computer running IIS. I recently bought a
new computer with XP Pro and this page times out. I now it is the call
to obj.guid. I have seen the same behaviour on another XP machine as
well.

The funny thing is if I paste this code into VB and display the guid
in a message box, it runs without a problem.

Any ideas, is this not supported in XP?

View Replies View Related

RegExp For URL

I am looking for a REgExp (or function) that will check a URL is entered in correctly

View Replies View Related

REGEXP

why the following code incorrectly returns 2 as matches count whereas when I change str = "179,80,179,80,179" I get the correct count which is 3?
str = "179,179,179"
num = 179

Set regEx = New RegExp
regEx.Global = true
regEx.IgnoreCase = True
regEx.Pattern = "(^|,)" & num & "($|,)"

Set colMatches = regEx.Execute(str)
response.write colMatches.Count & "<BR>"

View Replies View Related

RegExp Gods

I have a string which is an html document - I want to eliminate all the <script>blah blah</script> tags. I can't seem to get the regexp pattern right. Here's where I've got to:Code:

Set oReg = New RegExp
oReg.IgnoreCase = True
oReg.Pattern = "(<script[.
]*</script>)"

Set oMatches = oReg.Execute(sHTML)

For Each oMatch In oMatches
sHTML = Replace(sHTML, oMatch.Value, "")
Next

View Replies View Related

Vbscript RegExp

I am trying to write an asp(vbscript) parser for wiki-style pseudo code, and
can't get my head round regexp.

I am hoping if somebody could give me an example to work on for one, I could
sort the others.

e.g. how do you turn (from within a large string, with varying occurences)
.......[image:/mydir/pics/my portrait.jpg | A picture of me]......
into
......<img src="/mydir/pics/my%20portrait.jpg " alt="A picture of me">.....

View Replies View Related

RegExp Experts

I'm struggling trying to get the concepts of the regExp function down....

What i'm trying to achieve is to remove all white space from html formatted
source code.

I have the following regExp search string to remove all html source code but
that is not what i require.. RegExp.Pattern = "<.*?>"

I want to store all html source code and its text/image contents into a DB.

For that reason i want to remove all line breaks and spacing/tabs within the
source code so as to only have one exteremely long single line leaving the
formatting of the contents of the html code alone all so that i can stuff
into a varchar(MAX) field.

View Replies View Related

RegExp Question

what is the syntax for parenthesis? but i don't want to allow <> or / like S would (if i understand that correctly). would i use ascii then, as in: x40 and x41?

View Replies View Related

RegExp Question

Premise: Inserting data into a database form a <textarea> and
displaying this data through an HTML page.

When inserting data into a database via a text area and then displaying
this data any carriage return that was entered into the database was
lost. I Created a function to replace a carriage return with a <BR>. I
call this function when I display this data.

If I enter text inside <> into a database and then display this data,
any text that was within the <> is lost because it is considered an
HTML tag. How can I search the string for the brackets and actually
diplay them? I do not want to use Server.HTMLEncode before I insert the
data into the database. This is because we often query the database
from outside a web browser.

Here is my function I have for the carriage return. I need to figure
out how to accomplish this for both < and >. I am sure this is simple
but I do not know what the .pattern should be (for a carriage return it
is "
".

SET regQuote = New RegExp
regQuote.pattern = "
"
regQuote.global = True
catchCR = regQuote.Replace(strText, "<br>")

View Replies View Related

RegExp :: BB Code

I have a bit of code that replaces all links in my forums with hyperlinks. I'd like to add [url=www.sitehere.com]Link[/url] BB Code links to my forums. This is difficult to word, but how do you specify for RegExp to skip links if they are in [url] tags.

View Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved