Ejecting USB
hi,
is there a way I can eject the USB diskdrive whereby when i press a button it will say "Safely remove hardware" like in the computer taskbar?
for this code below is detect the USB if it is insertFile f =new File("f:/");
while (!f.exists())
try{
Thread.sleep(500);
}
catch (InterruptedException e){
}
thank you
jp
File f = new File("f:/");
while (!f.exists())
try {
Thread.sleep(500);
}
catch (InterruptedException e) {
}
while(f.exists())
try {
Thread.kill();
}
catch (InterruptedException e) {
}
thanks for the solution earlier but i can't compiled, it says cannot find symbol thread.kill()
by the way can i use this instead?while(f.exists())
try {
f.deleteOnExit();
}
catch (InterruptedException e) {
}
thanks
jp
Yeah. But first you have to go through the Windows APIs.Here, this might help you, although it probably won't: http://msdn2.microsoft.com/en-us/library/aa363216.aspx>why dont u try>Thread.Kill or Thread.Suspend Was that supposed to be sarcastic?
> Never trust anyone with under 1000 posts.Mm. Especially not when they apparently don't know correct spelling, grammar, or programming conventions.