问题虽小,难度可大 ....怎样?.... (10分)

  • 主题发起人 主题发起人 apple058
  • 开始时间 开始时间
A

apple058

Unregistered / Unconfirmed
GUEST, unregistred user!
请问:
1: 怎样判断光驱现在是打开还是关闭?
2: 怎样判断软去里面是否有软盘?
谢谢
 
好像只有控制的
 
大富翁里有,自己去查
判断光驱中是否有盘
function TForm1.diskindriv(Drive:char):boolean;
var
Errormode:word;
begin
{ make it upper case}
if Drive in ['a'..'z'] then
dec(drive,$20);
{make sure it is letter}
if not (drive in ['A'..'Z']) then
raise EconvertError.create('not a valid drive?');
{turn off critical error}
Errormode:=SetErrorMode(SEM_FailCriticalErrors);
try
{drive a=1,b=2,and so on}
if disksize(ord(Drive)-$40)=-1 then
result:=false
else
result:=true;
finally
seterrormode(errormode);
end
-------------------------------------
如何检查软驱中的软盘和光驱的光盘是否发生变化。
方法:
只要检查软驱和光驱中的磁盘的序列号发生变化即可!
function GetDiskVolSerialID(cDriveName : char ) : DWord;
var
dwTemp1,
dwTemp2 : DWord;
begin
GetVolumeInformation(
PChar( cDriveName + ':/' ), // address of root directory of the file system
Nil, // address of name of the volume
0, // length of lpVolumeNameBuffer
@Result, // address of volume serial number
dwTemp1, // address of system's maximum filename length
dwTemp2, // address of file system flags
Nil, // address of name of file system
0 // length of lpFileSystemNameBuffer
);
end;

 

各位真的没有办法????? ^_^
 
好像真的没办法的, 我已经查过N遍了.
 
saellen 谢谢,那汇编语言搞不搞得定?
 
我搞不定,我现在还在找一些英文的资料呢,找到了分你一份.
 
接受答案了.
 
后退
顶部