如何判断软盘是否处于写保护状态/
用什么方法可以检查出软盘写保护的状态呢?望各位大虾赐教! 问题点数:40、回复次数:6Top
1 楼forgot(忘记forgot2000)回复于 2002-05-07 15:23:28 得分 0
写软盘写不进。Top
2 楼erp2(天涯劍)回复于 2002-05-07 16:02:41 得分 0
try
写盘...
except
showmessage(处于写保护状态/...);
end;Top
3 楼Forren(影子)回复于 2002-05-07 21:00:57 得分 0
其实你根本没必要去专门判断软盘是否写保护.
你可以这样作;
...
if copyfile('e:\a.txt','a:\a.txt',false) then
//copy success ,do something
else
//copy false ,do something
....
在执行copyfile函数的过程中如果软盘是写保护的,windows会弹出提示框提示用户软盘已写保护.当用户确定后继续执行.
你要作的只是判断copyfile函数的返回值是真是假并执行相应的代码即可.Top
4 楼luoshumeng(乡村意外)回复于 2002-05-07 22:19:09 得分 0
高人指路!!!!!Top
5 楼ly_liuyang(Liu Yang LYSoft http://lysoft.7u7.net)回复于 2002-05-07 22:26:31 得分 40
try to write a small file to test it
var f:textfile;
try
assignfile(f,'a:\~temp.tmp');
rewrite(f);
write(f,'test');
closefile(f);
erase(f);
except
showmessage('write protect');
end;Top




