Club Delphi  
    FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > Varios
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

Grupo de Teaming del ClubDelphi

Respuesta
 
Herramientas Buscar en Tema Desplegado
  #1  
Antiguo 13-05-2006
Avatar de diniremix
diniremix diniremix is offline
Miembro
 
Registrado: abr 2006
Ubicación: Negaverso
Posts: 44
Poder: 0
diniremix Va por buen camino
desordenando

hola a todo@s
despues d varios dias sin entrar aqui d nuevo.

tengo una duda ya c q existen los algoritmos de ordenacion y todo eso, pero y sip quiero "desordenar" un dato d tal modo q sea casi "ilegible o al menos dificil" de leer alguna idea?

gracias a todos los comentarios
ah y sip saben d como les va con ETI hacerme saber en el correo
__________________
Diniremix ;)
Responder Con Cita
  #2  
Antiguo 13-05-2006
Avatar de marcoszorrilla
marcoszorrilla marcoszorrilla is offline
Capo
 
Registrado: may 2003
Ubicación: Cantabria - España
Posts: 11.221
Poder: 10
marcoszorrilla Va por buen camino
Supongo que quieres decir encriptar y no desordenar?

Aquí tienes un ejemplo sacado de Borland(de los muchos que puedes encontrar por ahí):



Encrypting and Decrypting strings in Delphi. - by Kendall Sullivan
Rating: Ratings: 4 Rate it
Abstract: Code sample demonstrates a basic Encryption/Decryption algorithm for strings.
QUESTION: How can I encrypt and decrypt string values?
ANSWER:
There are a number of ways to do this, below is a code sample that demonstrates one of the ways. Start with a form, and drop three Edit components, and two buttons. Add the EnDeCrypt function to the TForm1 class declaration in the type portion of the Unit. Omitting the TForm. section of the declaration. Then add the function in the implementation section of the Unit as shown below. Now double click each of the buttons and add the code as shown below. Run the project, in the Edit1 text area type in a word and click Button1. Now click Button2, you should see your word encrypted in Edit2 text and decrypted in Edit3 text. This should give you a basic idea on how Encryption works.

Código Delphi [-]
type
  TForm1 = class(TForm)
    Button1: TButton;
    Edit1: TEdit;
    Edit2: TEdit;
    Button2: TButton;
    Edit3: TEdit;
    procedure Button1Click(Sender: TObject);
    function EnDeCrypt(const Value : String) : String;
    procedure Button2Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

function TForm1.EnDeCrypt(const Value : String) : String;
var
  CharIndex : integer;
begin
  Result := Value;
  for CharIndex := 1 to Length(Value) do
    Result[CharIndex] := chr(not(ord(Value[CharIndex])));
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
  Edit2.Text := EnDeCrypt(Edit1.Text);
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
  Edit3.Text := EnDeCrypt(Edit2.Text);
end;

Un Saludo.
__________________
Guía de Estilo de los Foros
Cita:
- Ça c'est la caisse. Le mouton que tu veux est dedans.
Responder Con Cita
  #3  
Antiguo 15-05-2006
Avatar de diniremix
diniremix diniremix is offline
Miembro
 
Registrado: abr 2006
Ubicación: Negaverso
Posts: 44
Poder: 0
diniremix Va por buen camino
hola y gracias por la respuesta la verdad era "desordenar" y no "encriptar" pero m gustaron las lineas
interesantes
gracias de nuevo bytes!!
__________________
Diniremix ;)
Responder Con Cita
Respuesta



Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro


La franja horaria es GMT +2. Ahora son las 18:23:37.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi