11.01.2011, 10:30
|
|
Let Me Show You
|
|
Регистрация: 30.04.2010
Адрес: Северодвинск
Сообщения: 5,426
Версия Delphi: 7, XE5
Репутация: 59586
|
|
Код:
var
h: THandle;
buf: array [0..$ffff] of Char;
dummy: Cardinal;
begin
h:=CreateFile(
PChar('\\.\G:'),
GENERIC_READ or GENERIC_WRITE,
0,
nil,
OPEN_EXISTING,
0,
0
);
if h=0 then raise Exception.Create(SysErrorMessage(GetLastError));
SetFilePointer(h, $0000, nil, FILE_BEGIN);
if ReadFile(h, buf, SizeOf(buf), dummy, nil) then
Memo1.Text:=Copy(buf, 1, dummy)
else
ShowMessage(SysErrorMessage(GetLastError));
CloseHandle(h);
end;
__________________
Пишу программы за еду.
__________________
|