Ver Mensaje Individual
  #1  
Antiguo 09-11-2017
Milworm99 Milworm99 is offline
Miembro
NULL
 
Registrado: nov 2017
Posts: 31
Reputación: 0
Milworm99 Va por buen camino
Exclamation Problema con el StringList

Hola a toda la comunidad de clubdelphi, tengo un problema, quisiera añadir LICENCIAS a través de un servidor Hosting y que delphi lea las licencias agregadas.

Ejemplo este es mi hosting en donde agregare las licencias: latingamerz.000webhostapp.com/Licencias.txt

Al poner en mi hosting cualquier licencia ejemplo: WD-WAD5G4CKFUCT-0002-0652-BFEB-FBFF-0098-F89D

Quisiera que delphi compruebe las licencias si están agregadas a traves de mi hosting.

Este es el codigo que uso

Código:
function existeCadena (lista : TStringList; cadena : string) : boolean;
var
 posicion : integer;
begin
  lista.Sort;
  existeCadena := lista.Find(cadena, posicion);
  end;
Código:
procedure TForm1.Button1Click(Sender: TObject);
var
LICENCIAS : TStringList;
posicion : integer;
cadenaAComprobar : string;
begin
LICENCIAS:=TStringList.Create;
LICENCIAS.add('WD-WCC3F3CKFUCT-0002-0652-BFEB-FBFF-0098-E3BD');
cadenaAComprobar:=GetIdeDiskSerialNumber + '-' + GetScsiDiskSerialNumber + GetCPUSerialNumber;
  posicion := 0;
if existeCadena(LICENCIAS, cadenaAComprobar) then
  begin
   showMessage('LICENCIA ACTIVADA');
    end
  else
  begin
    LICENCIAS.Add(cadenaAComprobar);
    showMessage('LICENCIA NO ACTIVADA');
  end;
end;
end.
Espero su ayuda !! Gracias.