Hi,
It's possible but doing so is complex , I know if only one program (
ProcessExplorer ) that does it, no idea how though :(
The best you can do is trying to open the file with no sharing and catch the
exception if this fail, not the best way but it works
use this code
bool opened;
try{
FileStream fs = new FileStream( file, FileMode.Open, FileAccess.Write,
FileShare.None);
fs.Close();
opened = false;
}
catch( FileNotFoundException ex)
{
//what to do now?
opened = false;
}
catch( UnauthorizedAccessException e)
{
opened = true;
}
If you are 100% sure the file exist remove the first catch block
Cheers,
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"Marcel Hug" <ma**********@ch.abbdotcom> wrote in message
news:eK**************@TK2MSFTNGP14.phx.gbl...
Hello NG !
I would like to test, if a file in my subtree is allready in use by an
other
application.
Do anybody know how to get this information ? It is possible to get this
information ?
Thanks and regards.
Marcel Hug