![]() |
![]() |
| Paypal | FTP | CCD | Buscar | Trucos | Trabajo | Foros |
|
|||||||
| Registrarse | FAQ | Miembros | Calendario | Guía de estilo | Temas de Hoy |
|
|
Herramientas | Buscar en Tema | Desplegado |
|
#3
|
|||
|
|||
|
Lo he intentado ahcer pero nome sale.
Código:
unit Unit1;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
function DiskInDrive(Drive: Char): Boolean;
// Disk can be a floppy, CD-ROM,...
var
Form1: TForm1;
ErrorMode: Word;
begin
{ make it upper case }
if Drive in ['a'..'z'] then Dec(Drive, $20);
{ make sure it's a letter }
if not (Drive in ['A'..'Z']) then
raise EConvertError.Create('Not a valid drive ID');
{ turn off critical errors }
ErrorMode := SetErrorMode(SEM_FailCriticalErrors);
try
{ drive 1 = a, 2 = b, 3 = c, etc. }
if DiskSize(Ord(Drive) - $40) = -1 then
Result := False
else
Result := True;
finally
{ Restore old error mode }
SetErrorMode(ErrorMode);
end;
end;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
if DiskInDrive('a') = False then
ShowMessage('Drive not ready');
end;
end.
__________________
http://electronica-pic.blogspot.com....n-arduino.html Manuales de electrónica general, PIC y Arduino. |
|
|
Temas Similares
|
||||
| Tema | Autor | Foro | Respuestas | Último mensaje |
| Saber si hay disco en la unidad | chinchan | C++ Builder | 2 | 23-02-2013 02:28:02 |
| Saber el tipo de disco | MON___ | API de Windows | 1 | 27-12-2007 23:21:12 |
| Saber unidad de disco donde estoy | marceloalegre | Varios | 4 | 12-07-2005 16:47:27 |
| Como saber si existe un Directorio en el disco duro | franciscobucio | Varios | 1 | 18-10-2004 22:15:55 |
| Saber unidad d disco n ordenador remoto.. | Muten | Firebird e Interbase | 4 | 17-06-2004 17:59:40 |
|