hiola,tengo este código:
Código Delphi
[-]
procedure TForm1.Timer1Timer(Sender: TObject);
var encontradas: boolean;
n: integer;
begin
encontradas:= false;
if not(encontradas) then
begin
FileListBox1.Directory:='G:\';
directorio:='G:\';
FilelistBox1.Update;
if FileListBox1.Items.Count > 0 then
begin
Timer1.Enabled:= false;
encontradas:= true;
i:= 0;
RellenarFotos(i);
cantidades.Clear;
for n:= 0 to FileListBox1.Items.Count-1 do
begin
cantidades.Add('0');
end;
end;
end;
if not(encontradas) then
begin
FileListBox1.Directory:= 'E:\';
directorio:= 'E:\';
FilelistBox1.Update;
if FileListBox1.Items.Count > 0 then
begin
Timer1.Enabled:= false;
encontradas:=true;
i:= 0;
RellenarFotos(i);
cantidades.Clear;
for n:= 0 to FileListBox1.Items.Count-1 do
begin
cantidades.Add('0');
end;
end;
end;
if not(encontradas) then
begin
FileListBox1.Directory:= 'F:\';
directorio:= 'F:\';
FileListBox1.Update;
if FileListBox1.Items.Count > 0 then
begin
Timer1.Enabled:= false;
i:= 0;
RellenarFotos(i);
cantidades.Clear;
for n:= 0 to FileListBox1.Items.Count-1 do
begin
cantidades.Add('0');
end;
end;
end;
if not(encontradas) then
begin
FileListBox1.Directory:='H:\';
directorio:='H:\';
FileListBox1.Update;
if FileListBox1.Items.Count>0 then
begin
Timer1.Enabled:=false;
i:=0;
RellenarFotos(i);
cantidades.Clear;
for n:= 0 to FileListBox1.Items.Count-1 do
begin
cantidades.Add('0');
end;
end;
end;
end;
leerá esta unidad 'G',si está enchufada,pero si no está enchufada da error.
¿Algún componente q lee de lector de tarjetas,USB,grabadora DVD,Blueetooh,...?
ES para leer automáticamente fotos de una SD por ejemplo.
Saludos delfileros.