Club Delphi  
    Paypal   FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Otros entornos y lenguajes > Lazarus, FreePascal, Kylix, etc.
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

 
 
Herramientas Buscar en Tema Desplegado
  #4  
Antiguo 04-11-2008
Avatar de cHackAll
[cHackAll] cHackAll is offline
Baneado?
 
Registrado: oct 2006
Posts: 2.159
Poder: 22
cHackAll Va por buen camino
Dispositivos montados:

Código Delphi [-]
procedure TForm1.Button1Click(Sender: TObject);
var
 Str: string;
 Index, Pos: Integer;
begin
 ListBox1.Items.LoadFromFile('/etc/mtab');
 Index := 0;
 while Index < ListBox1.Count do
  begin
   Str := ListBox1.Items[Index];
   if Copy(Str, 1, 5) <> '/dev/' then
    ListBox1.Items.Delete(Index)
   else
    begin
     Pos := System.Pos(' ', Str);
     repeat Inc(Pos);
     until Str[Pos] = ' ';
     ListBox1.Items[Index] := Copy(Str, 1, Pos);
     Inc(Index);
    end;
  end;
end;

Dispositivos según sistema de archivos:

Código Delphi [-]
procedure TForm1.Button2Click(Sender: TObject);
var
 Str: string;
 Index, Pos: Integer;
begin
 ListBox1.Items.LoadFromFile('/etc/fstab');
 Index := 0;
 while Index < ListBox1.Count do
  begin
   Str := ListBox1.Items[Index];
   if (Str <> '') and (Str[1] = '#') then
    if (Index < (ListBox1.Count - 1)) and (Copy(ListBox1.Items[Index + 1], 1, 5) = 'UUID=') then
     begin
      Str := Copy(Str, 3, 255) + Copy(ListBox1.Items[Index + 1], 42, 255);
      ListBox1.Items.Delete(Index + 1);
     end
    else
     Str := '';
   if (Str = '') or (Str[1] <> '/') then
    ListBox1.Items.Delete(Index)
   else
    begin
     repeat Pos := System.Pos('  ', Str);
      if Pos <> 0 then
       Delete(Str, Pos, 1);
     until Pos = 0;
     Pos := System.Pos(' ', Str); // just the physical device and the mount point.
     repeat Inc(Pos);
     until Str[Pos] = ' ';
     ListBox1.Items[Index] := Copy(Str, 1, Pos);
     Inc(Index);
    end;
  end;
end;

Saludos
__________________
RTFM > STFW > Foro > Truco > Post > cHackAll > KeBugCheckEx

Última edición por cHackAll fecha: 04-11-2008 a las 02:50:30.
Responder Con Cita
 



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

Temas Similares
Tema Autor Foro Respuestas Último mensaje
Lazarus para PokcetPC pborges36 Lazarus, FreePascal, Kylix, etc. 2 28-11-2007 00:49:16
[Lazarus] GTK+-devel en SUSE. problema instalar lazarus de esa libreria. sakuragi Lazarus, FreePascal, Kylix, etc. 3 28-09-2006 03:31:09
drivecombobox,directorylistbox,filelistbox noipa Varios 1 24-01-2006 15:39:35
Validar DriveComboBox pkbza Varios 2 01-06-2004 17:12:27
¿Donde encuentro los DriveComboBox y los FileListBox? en el Delphi 5 aragorneuf Varios 2 05-04-2004 02:27:58


La franja horaria es GMT +2. Ahora son las 00:17:47.


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