- Code: Select all Expand view RUN
if GetNetCardID() <> 'XXXXXXX'
MsgInfo('This Computer is not licensed')
endif
if GetNetCardID() <> 'XXXXXXX'
MsgInfo('This Computer is not licensed')
endif
if GetNetCardID() <> 'XXXXXXX'
MsgInfo('This Computer is not licensed')
endif
registro DIALOG 77, 49, 211, 175
STYLE 0x4L | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME | WS_MINIMIZEBOX | WS_MAXIMIZEBOX
CAPTION "Acesso ao sistema"
FONT 8, "MS Sans Serif"
{
EDITTEXT 103, 98, 130, 102, 12, ES_UPPERCASE | WS_BORDER | WS_TABSTOP
PUSHBUTTON "C&onfirma", 201, 5, 157, 64, 14
PUSHBUTTON "&Cancela", 203, 76, 157, 62, 14
PUSHBUTTON "Demonstração", 204, 145, 157, 62, 14
EDITTEXT 101, 98, 113, 102, 12, ES_UPPERCASE | ES_READONLY | WS_BORDER | WS_TABSTOP
LTEXT "", 98, 311, 21, 98, 148, NOT WS_GROUP
ICON "icon_Chaves", -1, 8, 9, 21, 20
LTEXT "Este aplicativo está em MODO DEMONSTRAÇÃO.", 90, 35, 9, 170, 18
GROUPBOX "", -1, 5, 101, 202, 50, BS_GROUPBOX
CONTROL "", 97, "static", SS_BLACKRECT | WS_CHILD | WS_VISIBLE, 219, 3, 202, 66
LTEXT "Número de Série:", 95, 12, 115, 60, 8
LTEXT "Código de Liberação:", 96, 12, 131, 72, 8
LTEXT "Para avaliar a Versão de Demonstração clique no botão Demonstração.", 91, 35, 27, 170, 18
LTEXT "Registre o programa e receba o Código de Liberação para utilizar o produto completo.", 92, 35, 55, 170, 18
LTEXT "Entre em contato com o suporte através do telefone (11) 3903-4461", 93, 35, 84, 170, 18
}
icon_Chaves ICON
{
'00 00 01 00 01 00 20 20 10 00 00 00 00 00 E8 02'
'00 00 16 00 00 00 28 00 00 00 20 00 00 00 40 00'
'00 00 01 00 04 00 00 00 00 00 80 02 00 00 00 00'
'00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00'
'00 00 00 00 80 00 00 80 00 00 00 80 80 00 80 00'
'00 00 80 00 80 00 80 80 00 00 80 80 80 00 C0 C0'
'C0 00 00 00 FF 00 00 FF 00 00 00 FF FF 00 FF 00'
'00 00 FF 00 FF 00 FF FF 00 00 FF FF FF 00 00 00'
'00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00'
'00 00 00 00 08 80 00 00 00 00 00 00 00 00 00 00'
'00 00 00 00 F8 78 00 00 00 00 00 00 00 00 00 00'
'00 08 80 07 08 78 00 00 00 00 00 00 00 00 00 00'
'07 78 88 00 78 78 00 00 00 00 00 00 00 00 00 00'
'07 F8 78 7F 88 78 00 00 00 00 00 00 70 00 00 00'
'07 F8 78 07 F8 78 00 00 00 00 00 07 B3 30 00 00'
'00 08 78 0F 08 78 00 00 00 00 07 00 BB 70 00 00'
'00 78 78 00 78 78 00 00 00 00 73 3B B7 00 00 00'
'7F 88 78 7F 88 78 00 00 00 00 7B BB 70 30 00 00'
'07 F8 78 7F 88 78 00 00 00 70 0B B7 03 00 00 00'
'00 08 78 07 F8 78 00 00 07 33 BB 70 30 00 00 00'
'00 78 78 07 F8 77 00 00 7B BB B7 03 00 00 00 00'
'7F 88 78 7F 88 F7 00 00 7B BB 70 30 00 00 00 00'
'7F 88 77 F8 8F 88 70 00 BB B7 03 00 00 00 00 00'
'07 F8 7F 88 F0 00 00 0B BB 70 30 00 00 00 00 00'
'07 F7 F8 80 07 77 77 7B B7 03 00 00 00 00 00 00'
'7F 7F 88 07 7B BB BB BB 70 30 00 00 00 00 00 07'
'F8 7F 80 7B BB BB BB B8 B3 00 00 00 00 00 00 7F'
'88 7F 80 BB BB 8B 8B 8B 83 00 00 00 00 00 07 F8'
'8F 7F 0B BB B0 B0 B8 B8 B3 00 00 00 00 00 7F 88'
'F8 7F 7B BB BB 0B 0B 8B 83 00 00 00 00 00 7F 88'
'8F 87 7B BB BB B0 B0 B8 B3 00 00 00 00 00 7F 88'
'F8 00 7B BB 77 0B 0B 0B 83 00 00 00 00 00 7F 88'
'80 7F 7B B0 F8 80 B0 B8 30 00 00 00 00 00 7F 88'
'F0 78 7B B0 0F 80 BB B8 30 00 00 00 00 00 07 F8'
'80 77 07 B0 07 F0 BB 83 00 00 00 00 00 00 00 7F'
'88 00 08 77 00 0B B3 30 00 00 00 00 00 00 00 07'
'FF F0 78 70 88 88 30 00 00 00 00 00 00 00 00 00'
'77 70 77 70 77 77 00 00 00 00 00 00 00 00 00 00'
'00 00 70 00 70 00 00 00 00 00 00 00 00 00 00 00'
'00 00 00 00 00 00 00 00 00 00 00 00 00 00 FF F9'
'FF FF FF F0 FF FF FE 60 7F FF FC 00 7F FF F8 00'
'7F FF F8 00 7F F1 F8 00 7F E0 FC 00 7F 80 F8 00'
'7F 00 F0 00 7F 00 F8 00 7C 01 FC 00 78 03 F8 00'
'70 07 F0 00 70 0F F0 00 20 1F F8 00 00 3F F8 00'
'00 7F F0 00 00 FF E0 00 01 FF C0 00 01 FF 80 00'
'01 FF 00 00 01 FF 00 00 01 FF 00 00 01 FF 00 00'
'03 FF 00 00 03 FF 80 00 07 FF C0 00 0F FF E0 00'
'1F FF F0 10 7F FF FE 73 FF FF FF 07 FF FF'
}
/* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *
* Procedure_: REGISTRO.PRG
* Autor_____: Jose Carlos da Rocha - Konectiva Automacao
* Cria‡„o___: 13 de Dezembro de 2005
* Objetivo__: Pedir codigo de registro para habilitar aplicacao totalmente
* Rotina____: Executavel stand-alone chamado pelo aplicativo principal
* Direitos__: Qualquer alteração neste código pode ser feita deste que
* seja mantida a autoria principal.
* Alterado__: ___/___/____
* por_______: ___________________________________________
* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
#include "FiveWin.ch"
//----------------------------------------------------------------------------//
function Main()
local oDlg, oGet, oText1, oText2
local nSerie := substr(HDSERIAL(),1,8)
local nLiberacao:= space(8)
SET _3DLOOK ON
DEFINE DIALOG oDlg NAME "registro" COLOR RGB(000,000,000),RGB(255,255,255)
REDEFINE SAY ID 90 OF oDlg COLOR RGB(000,000,000),RGB(255,255,255)
REDEFINE SAY ID 91 OF oDlg COLOR RGB(000,000,000),RGB(255,255,255)
REDEFINE SAY ID 92 OF oDlg COLOR RGB(000,000,000),RGB(255,255,255)
REDEFINE SAY ID 93 OF oDlg COLOR RGB(000,000,000),RGB(255,255,255)
REDEFINE SAY ID 95 OF oDlg COLOR RGB(000,000,000),RGB(255,255,255)
REDEFINE SAY ID 96 OF oDlg COLOR RGB(000,000,000),RGB(255,255,255)
// Altere os comandos WinExec para chamarem o seu aplicativo principal
REDEFINE BUTTON oBtn201 ID 201 OF oDlg ACTION ( PROTECT3(), WinExec( "NFWH.EXE" ), oDlg:End() )
REDEFINE BUTTON ID 203 OF oDlg ACTION oDlg:End()
REDEFINE BUTTON ID 204 OF oDlg ACTION ( WinExec( "NFWH.EXE demo" ), oDlg:End())
//
REDEFINE GET oText1 VAR nSerie ID 101 PICTURE "@!" OF oDlg COLOR RGB(255,255,255),RGB(000,000,255) NO MODIFY
REDEFINE GET oText2 VAR nLiberacao ID 103 PICTURE "@!" OF oDlg VALID lOkPassword(nLiberacao,nSerie,oBtn201)
ACTIVATE DIALOG oDlg CENTERED ON INIT (oBtn201:Disable(),oText2:SetFocus())
return nil
FUNCTION PROTECT3()
PRIVATE ARQ, BUFFERS, RET, PALAVRA, P, T, ARQUIVO1
SET CENTURY OFF
REGISTRO := "HDHDHDHDRBRBRBRB99999999YYYYYYYYYYYY"
HDSERIAL := SUBSTR(HDSERIAL(),1,8) // Serial do HD
MAXDAYS := "30" // Tempo maximo de DIAS de uso
ROMBIOS := "RBRBRB" // CheckSum da RomBios
MAXUSERS := "05" // Maximo de usuarios por sessao
MAXTRIAL := SUBSTR(STRTRAN(DTOC(MAXTRIAL(MAXDAYS)),'/',''),1,6) // Tempo maximo de uso
ARQUIVO1 := "NFWH.EXE" // Nome do aplicativo
PALAVRA := "KONECTIVA" // String a ser protegida ate 10 caracteres
PROTEGER := HDSERIAL+MAXDAYS+ROMBIOS+MAXUSERS+MAXTRIAL // Dados para serem armazenados
IF REPL("HD",4) $ REGISTRO
//MSGRUN( "Protegendo..." )
ARQ := FOPEN(ARQUIVO1,2)
IF FERROR() # 0
MSGRUN( "Erro na abertura do arquivo "+ARQUIVO1 )
QUIT
ENDIF
T = FSEEK(ARQ,0,2)
FSEEK(ARQ,0,0)
BUFFER := SPACE(512)
BUFFE0 := PROTEGER+SPACE(512-LEN(PROTEGER))
P := 0
FOR A = 1 TO 512
P := P + ASC(SUBS(SUBSTR(ROMBIOS+SPACE(12),1,12),A,1)) + A
NEXT
PALAVRA := ALLTRIM(PALAVRA)
PS := ACHOU(PALAVRA)
IF PS = 0
//MSGRUN( "String nao encontrada em "+ARQUIVO1 )
QUIT
ENDIF
BYTES1 := 0
FOR A = 1 TO 512
BYTES1 := BYTES1 + ASC(SUBS(BUFFE0,A,1)) + A
NEXT
IF ACHOU(REPL("HD",4)) = 0
//MSGRUN( "String de prote‡„o nao foi encontrada em "+ARQUIVO1 )
RETURN 0
ENDIF
L = AT("HDHD",BUFFER)
BUFFER1 := SUBS(PROTEGER+SPACE(24),1,24)+STRZERO(P,12)
BUFFER := STUFF(BUFFER,L,36,BUFFER1)
FSEEK(ARQ,-512,1)
FWRITE(ARQ,BUFFER)
FCLOSE(ARQ)
//MSGRUN( "Protegido... " )
//@ 4,0 SAY "Verifica‡„o conferida"
//INKEY(3)
ELSE
//MSGRUN( "Ambientando..." )
ARQUIVO := "NFWH.EXE"
HDSERIAL := SUBS(REGISTRO, 1, 8) // Serial do HD
MAXDAYS := VAL(SUBS(REGISTRO, 9, 2)) // Maximo de Dias
ROMBIOS := SUBS(REGISTRO,11, 6) // STR(ROMCKSUM(),8) // CheckSum da RomBios
MAXUSERS := VAL(SUBS(REGISTRO,17, 2)) // Maximo de usuarios por sessao
MAXTRIAL := CTOD(SUBS(REGISTRO,21, 2)+"/"+;
SUBS(REGISTRO,19, 2)+"/"+;
SUBS(REGISTRO,23, 2))
DESLOCA := VAL(SUBS(REGISTRO,25,12))
//
// -> Rotinas de verificacao de travas
IF HDSERIAL() <> HDSERIAL ; RETURN 1; ENDIF
IF ROMBIOS(ROMBIOS) <> ROMBIOS ; RETURN 2; ENDIF
IF MAXUSERS(MAXUSERS) > MAXUSERS ; RETURN 3; ENDIF
IF (MAXTRIAL() > MAXTRIAL+30) .OR. (MAXTRIAL > DATE()); RETURN 4; ENDIF
ENDIF
RETURN 0
FUNCTION HDSERIAL()
RETURN ALLTRIM(STR(nSerialHD()))
FUNCTION MAXUSERS(MAXUSERS)
RETURN 0
FUNCTION ROMBIOS(ROMBIOS)
RETURN ROMBIOS
FUNCTION MAXTRIAL(MAXDAYS)
RETURN date()+val(MAXDAYS)
FUNCTION ACHOU(PALAVRA)
PRIVATE Q
FSEEK(ARQ,0,0)
FOR Q = 0 TO T STEP + 512
FREAD(ARQ, @BUFFER, 512)
IF AT(PALAVRA, BUFFER) # 0
RETURN Q
ENDIF
NEXT
RETURN 0
FUNCTION lOkPassword(nLiberacao,nSerie)
if val(nLiberacao)+val(nSerie)=99999999
oBtn201:Enable()
else
oBtn201:Disable()
endif
return .t.
#INCLUDE "FIVEWIN.CH"
Func Test()
Local aNet := {},;
nI := 0
msgInfo( "Test Begin..." )
aNet := GetMacAddress()
msgInfo( "Test OK" )
If Len(aNet) > 0
MsgInfo( "You have:["+Str( Len(aNet), 2, 0 )+"] Network Cards!" )
For nI := 1 To Len(aNet)
cStr := []
cStr += [Card Num:]+Str(nI,2,0)+CRLF
cStr += [Desc:]+aNet[nI,1]+CRLF
cStr += [Mac Address:]+aNet[nI,2]+CRLF
msgInfo( cStr, "Your Network Cards" )
Next nI
Else
Tone( 1000, 1 )
MsgStop( "No any Network Card!!" )
EndIf
Return NIL
if GetNetCardID() <> 'XXXXXXX'
MsgInfo('This Computer is not licensed')
endif
This is useful only when the user has an eithernet card in his P.C
and to control multi-user applications. It may not be useful for stand
alone applications.
If the user has several eithernet cards in his P.C ?
or
If he keep changing his eithernet cards frequently ?
areang wrote:I will send you by your private email
Areang
ssbbs wrote:RAMESHBABU wrote:Hi Jeff
Thank you very much for quick reply.
Now your solution to the problem in subject is complete.
Regards
- Ramesh Babu P
reference the web link:
http://www4.zzz.com.tw/phpbb2/viewtopic.php?t=26
You can get HDD Lower level serial-number!!
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 44 guests