Number licence xxxx-xxxx-xxxx-xxxx

Number licence xxxx-xxxx-xxxx-xxxx

Postby Silvio » Thu Feb 01, 2007 9:57 am

Have you and Idea or a function to create number licence as Office Microsoft Licence ?
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Postby UD previous posts » Thu Feb 01, 2007 11:05 am

u can use 123456789 and abcdefghijklmnopqrstuvwxyz to create Office Style

Serial numbers
UD previous posts
 
Posts: 42
Joined: Sat Sep 30, 2006 9:43 am

Postby Silvio » Thu Feb 01, 2007 11:40 am

????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
what ????????????
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Postby Rochinha » Thu Feb 01, 2007 1:53 pm

Amiguinho

See this

REGIDA := nSerialHD()
REGIDB := nSerialHD()

REGIDC := ""
REGIDC := REGIDC+SUBS(REGIDA,1,1)+SUBS(REGIDB,8,1)
REGIDC := REGIDC+SUBS(REGIDA,2,1)+SUBS(REGIDB,7,1)
REGIDC := REGIDC+"-"
REGIDC := REGIDC+SUBS(REGIDA,3,1)+SUBS(REGIDB,6,1)
REGIDC := REGIDC+SUBS(REGIDA,4,1)+SUBS(REGIDB,5,1)
REGIDC := REGIDC+"-"
REGIDC := REGIDC+SUBS(REGIDA,5,1)+SUBS(REGIDB,4,1)
REGIDC := REGIDC+SUBS(REGIDA,6,1)+SUBS(REGIDB,3,1)
REGIDC := REGIDC+"-"
REGIDC := REGIDC+SUBS(REGIDA,7,1)+SUBS(REGIDB,2,1)
REGIDC := REGIDC+SUBS(REGIDA,8,1)+SUBS(REGIDB,1,1)

This returns a number with "XXXX-XXXX-XXXX-XXXX" format.

Or use this:

REGIDA := GerarSenha(16,2)

REGIDC := ""
REGIDC := REGIDC+SUBS(REGIDA,1,1)+SUBS(REGIDA,2,1)
REGIDC := REGIDC+SUBS(REGIDA,3,1)+SUBS(REGIDA,4,1)
REGIDC := REGIDC+"-"
REGIDC := REGIDC+SUBS(REGIDA,5,1)+SUBS(REGIDA,6,1)
REGIDC := REGIDC+SUBS(REGIDA,7,1)+SUBS(REGIDA,8,1)
REGIDC := REGIDC+"-"
REGIDC := REGIDC+SUBS(REGIDA,9,1)+SUBS(REGIDA,10,1)
REGIDC := REGIDC+SUBS(REGIDA,11,1)+SUBS(REGIDA,12,1)
REGIDC := REGIDC+"-"
REGIDC := REGIDC+SUBS(REGIDA,13,1)+SUBS(REGIDA,14,1)
REGIDC := REGIDC+SUBS(REGIDA,15,1)+SUBS(REGIDA,16,1)

Function GerarSenha(MaxNum,Tipo)
* 1 = Somente Numeros
* 2 = Numero e Letras
* 3 = Somente Letras
local chave := ""
var_valores := { "0123456789",;
"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ",;
"ABCDEFGHIJKLMNOPQRSTUVWXYZ" }[Tipo]
for i = 1 to MaxNum
num := random(len(var_valores))
chave := chave + substr(var_valores,num,1)
next
return lTrim(chave)
Rochinha
 
Posts: 309
Joined: Sun Jan 08, 2006 10:09 pm
Location: Brasil - Sao Paulo

Postby Silvio » Thu Feb 01, 2007 2:40 pm

Good Mr Rochinha

BUT NOT FOUND RANDOM FUNCTION
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Postby James Bott » Thu Feb 01, 2007 5:20 pm

Silvio,

Here is a random() function that I found somewhere.

James


/*

Here is a simple but good working random number generator for with a
period of 2^31-2. It generates uniformly distributed numbers in the
range from 0 to 1, limits included.

Clipper code donated to the Public Domain by Phil Barnett November 29, 1996

Random numbers donated to the Universe by God.

*/

static seed := 0

/*
procedure test()

local d := date()
local x

SET DECIMAL TO 16

// call it once with the seed
random( seconds() * day( d ) * month( d ) * year( d ) )

do while !lastkey() == 27

// then, call it with no parameter repeatedly
x := random()
? x

// produces random numbers in the range of 0 - 100 inclusive
?? int( x * ( 100 + 1 ) )

// produces random numbers in the range of 1 - 100 inclusive
?? int( x * 100 ) + 1

// produces random numbers in the range of 0 - 99 inclusive
?? int( x * 100 )

// inkey(.01)

enddo

return
*/

********************************************************************

function random( s )

local a := 16807 // This is just a lucky prime number

// you can hardcode these as constants for better speed
local m := ( 2 ^ 31 ) - 1
local q := int( m / a )
local r := int( m % a )

if valtype( s ) == 'N'
seed := s
endif

seed := a * ( seed % q ) - r * ( seed / q )

IF seed <= 0
seed += m
endif

return ( seed - 1 ) / ( m - 2 )

/*
Other Prime Numbers are:

38833
37171
11903
18233
31337
23339
27481
31063
34543 // an anagram prime!
36299
13691
17659
29411

If you need more, get the SIEVE.ZIP program and modify it.

*/
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Postby Antonio Linares » Thu Feb 01, 2007 5:31 pm

Silvio,

FW provides nRandom( [nRange] )
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41314
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Silvio » Thu Feb 01, 2007 5:34 pm

thanks to all
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Postby Jeff Barnes » Fri Feb 02, 2007 12:23 am

Hi Silvio,

I don't know if this will help you but you can look at this post....

[url]
http://fivetechsoft.com/forums/viewtopi ... ght=#19497
[/url]



Jeff
User avatar
Jeff Barnes
 
Posts: 929
Joined: Sun Oct 09, 2005 1:05 pm
Location: Ontario, Canada

Postby Maurilio Viana » Fri Feb 02, 2007 11:26 am

Rochinha and All,

In my routine I avoid use 0 (zero) number and O (upper "o") character to avoid confuse the user...

Regards
Maurilio
User avatar
Maurilio Viana
 
Posts: 252
Joined: Tue Oct 25, 2005 2:48 pm
Location: Garça/Garza/Heron City - Brazil

Postby Rochinha » Fri Feb 02, 2007 1:12 pm

Yes

One question, a lot of solution, it's good.
Rochinha
 
Posts: 309
Joined: Sun Jan 08, 2006 10:09 pm
Location: Brasil - Sao Paulo

Postby Silvio » Fri Feb 02, 2007 5:36 pm

JEFF
WHERE ARE THE KEYGEN SOURCES
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Postby cgomez » Mon Oct 20, 2008 9:32 am

Como puedo crear un numero aleatorio de 6 dígitos
cgomez
 
Posts: 16
Joined: Mon Feb 18, 2008 6:27 pm

Postby Enrico Maria Giordano » Mon Oct 20, 2008 11:19 am

Code: Select all  Expand view
Hb_RandomInt( 111111, 999999 )


EMG
User avatar
Enrico Maria Giordano
 
Posts: 8315
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

KeyGen32

Postby David Williams » Mon Oct 20, 2008 9:36 pm

Hi Jeff

Can you supply the download link to KeyGen32 again as it has expired?

Many thanks
David
User avatar
David Williams
 
Posts: 82
Joined: Fri Mar 03, 2006 6:26 pm
Location: Ireland

Next

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Silvio.Falconi and 92 guests