Pascal/Turbo Pascal - Colorcale Clave

 
Vista:

Colorcale Clave

Publicado por Razer (3 intervenciones) el 30/07/2011 23:08:18
Hola Amigos Me pregunto si sera posible colocarle clave a un programa.. osea cuando el usuario vaya a ejecutar el programa que le pida una clave.. Como lo puedo hacer¿? Gracias
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

Colorcale Clave

Publicado por Ramon (2158 intervenciones) el 31/07/2011 13:25:56
Mesupongo que sera en programas echos en pascal si es asin tedire que si se puede colocar
clave al arranque del programa para una o varias personas cada una con una clave.
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

Colorcale Clave

Publicado por Razer (3 intervenciones) el 01/08/2011 00:44:05
si man es un programa echo en pasacl.. en realidad es mi proyecto final del semestre y me gustaria meterle clave al programa.. no es que sea la gran cosa el programa sino para mayor presentacion pues jeje.. como lo haria?
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

Colorcale Clave

Publicado por ramon (2158 intervenciones) el 01/08/2011 18:17:55
{A qui tienes un ejemplo que te ayudara aunque sea un poco so sito pero te indicara como puede realizarse lo que quieres siendo de mayor o menor dificultad suerte}

program paswor;
uses
crt;
const
maestro : array[1..15] of longint = (ord('1') * 3,ord('2') * 3,ord('3') * 3,
ord('4') * 3,ord('5') * 3,0,0,0,0,0,0,0,0,0,0);
{Paswor De Inicio y Seguridad 12345}
dat = 5;
type
dato = record
pasw : array[1..15] of longint;
lon : integer; {Paswor Para Los Usuarios Que Desee}
end;
string15 = string[15];


var
paswo1, paswo : dato;
f : file of dato;
tomado1, mast, tomado : boolean;
code1, code2 : string15;
ki : integer;

procedure validacion;
var
tecla : char;
k, x, y, i : integer;
paw : string[15];
sies, archivo : boolean;
cont : longint;
begin
assign(f,'Pasw.axx');
{$I-} reset(f); {$I+}
if ioresult <> 0 then
begin
archivo := false;
end
else
begin
archivo := true;
close(f);
end;
fillchar(paw,16,' ');
paw[0] := chr(15);
x := 10;
y := 4;
gotoxy(x,y - 2);write('*** [Enter] Finaliza [Esc] Avandona ***');
gotoxy(x,y);write('Entre Paswor : ');
x := 24;
i := 1;
repeat
tecla := readkey;
if tecla in[#48..#67,#65..#90,#97..#122,#164,#165,#32] then
begin
paw[i] := tecla;
paw[0] := chr(i);
gotoxy(x + i,y);write('*');
i := i + 1;
if i > 15 then
i := 15;
end;
if tecla = #8 then
begin
i := i - 1;
if i < 1 then
i := 1;
paw[i] := ' ';
paw[0] := chr(i);
gotoxy(x + i,y);write(' ');
end;
if tecla in[#48..#67,#65..#90,#97..#122,#164,#165,#32,#8,#13,#27] then
begin
end
else
begin
gotoxy(x,y + 4);write('<< Tecla Invalida >>');
delay(2000);
gotoxy(x,y + 4);clreol;
gotoxy(x + i,y);
end;
until (tecla = #13) or (tecla = #27);
if tecla = #13 then
begin
k := 0;
mast := false;
k := length(paw);
for i := 1 to k do
begin
paswo1.pasw[i] := ord(paw[i]) * 3;
end;
paswo1.lon := k;
if archivo = false then
begin
tomado := false;
for i := 1 to dat do
begin
code1[i] := chr(paswo1.pasw[i] div 3);
code1[0] := chr(i);
code2[i] := chr(maestro[i] div 3);
code2[0] := chr(i);
end;
if code1 = code2 then
begin
tomado := true;
mast := true;
end
else
tomado := false;
end
else
begin
assign(f,'Pasw.axx');
{$I-} reset(f); {$I+}
if ioresult <> 0 then
begin
halt(1);
end;
cont := 0;
sies := false;
tomado1 := false;
repeat
seek(f,cont);
read(f,paswo);
for i := 1 to paswo.lon do
begin
code1[i] := chr(paswo.pasw[i] div 3);
code1[0] := chr(i);
code2[i] := chr(paswo1.pasw[i] div 3);
code2[0] := chr(i);
end;
if code1 = code2 then
begin
sies := true;
tomado1 := true;
tomado := false;
end;
cont := cont + 1;
until (cont > filesize(f) - 1) or (sies = true);
close(f);
end;
end;
end;

procedure menus;
var
usuario : boolean;
tec : char;
x, y, za : integer;
usu : string[15];
begin
if tomado = true then
begin
clrscr;
writeln;
writeln('***** Su Paswor Master Es Correcto *****');
writeln('Desea Introducir Paswor De Usuario [S/N]');
repeat
tec := readkey;
until tec in['s','S','n','N'];
if tec in['s','S'] then
begin
gotoxy(4,4);write(' Entre Paswor Usuario : ');
gotoxy(27,4);
fillchar(usu,16,' ');
usu[0] := chr(15);
za := 1;
repeat
tec := readkey;
if tec = #13 then
begin
usuario := true;
end;
if tec in[#48..#67,#65..#90,#97..#122,#164,#165,#32] then
begin
usu[za] := tec;
usu[0] := chr(za);
gotoxy(x + za,y);write('*');
za := za + 1;
if za > 15 then
za := 15;
end;
if tec = #8 then
begin
za := za - 1;
if za < 1 then
za := 1;
usu[za] := ' ';
usu[0] := chr(za);
gotoxy(x + za,y);write(' ');
end;
until (usuario = true) or (tec = #27);
if usuario = true then
begin
for za := 1 to length(usu) do
begin
paswo.pasw[za] := ord(usu[za]) * 3;
end;
paswo.lon := length(usu);
assign(f,'Pasw.axx');
{$I-} reset(f); {$I+}
if ioresult <> 0 then
begin
rewrite(f);
seek(f,0);
write(f,paswo);
close(f);
end
else
begin
seek(f,filesize(f));
write(f,paswo);
close(f);
end;
end;
end;
end
else
begin
clrscr;
writeln('Lo Que Desea Realizar');
readln;
end;
end;




begin
clrscr;
textcolor(15);
validacion;
writeln;
if (tomado = true) or (tomado1 = true) then
begin
menus;
end
else
begin
clrscr;
writeln;
textcolor(14);
writeln(' @@@@@ Su Paswor Es Incorrecto >> LO SIENTO << @@@@@ ');
writeln(' ****** Pulse Una Tecla ********');
repeat until keypressed;
textcolor(15);
halt(1);
end;
end.
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar