Black Templar Admin
Nombre de messages : 356 Age : 35 Localisation : Lille (France) language de prog : Liberty BASIC; HTML; CSS; php; MySQL; C expérience en prog : Amateur Date d'inscription : 06/08/2005
| Sujet: Mot de passe (configurable) Sam 15 Avr - 11:13 | |
| Voici un programme de mot de passe qui utilise une interface graphique (je pense plus jolie que ceux de Window) - Code:
-
'By Black Templar '24/02/2006 'Open Source 'Password : passwd
nomainwin
'API qui emmetun bruit calldll #user32, "MessageBeep", _MB_ICONQUESTION as long, result as boolean
'API de demande de confirmation flags = _MB_ICONQUESTION OR _MB_YESNO calldll #user32, "MessageBoxA", _ 0 as long, _ "Voulez-vous utiliser ce logiciel ?" as ptr, _ "Accés :" as ptr, _ flags as long, _ result as long if result = 7 then end
WindowWidth = 100 WindowHeight = 50 UpperLeftX = (DisplayWidth - WindowWidth) / 2 UpperLeftY = (DisplayHeight - WindowHeight) / 2
graphicbox #1.gr, 0, 0, 100, 50 stylebits #1, 0, 0, _WS_EX_TOOLWINDOW or _WS_EX_TOPMOST, 0 'pour que le focus soit toujours sur la fenêtre
open "" for window_popup as #1
#1.gr,"goto 1 1; backcolor black; down; box 97 47" #1.gr,"goto 1 1; backcolor black; down; boxfilled 97 24" #1.gr, "goto 13 17;down;color 255 255 255;backcolor 0 0 0;\Password :" #1.gr, "setfocus" #1, "trapclose [exit]" #1.gr,"when characterInput [plus]"
caractere = 1 position = 10 pass$ = ""
wait
[plus] pass$ = pass$ + Inkey$ #1.gr,"up; goto ";position;" 35; backcolor black; down; circlefilled 7" #1.gr,"up; goto ";position - 2;" 32; backcolor white; down; circlefilled 1" position = position + 15 caractere = caractere + 1 if caractere > 6 goto [verif] wait
[verif] if pass$ = "passwd" then notice "Accés autorisés !" else notice "Accés refusés !" end if
[exit] close #1 end
a+ | |
|