how to delete file when in use

  • Thread starter Thread starter Jason S.
  • Start date Start date
J

Jason S.

I have an app in which I want to remove a directory on disk. The below code
works just fine unless there is a user logged in through the FTP site to
this directory.

string sFtpPath = @"C:\SomeFTPpath";
DirectoryInfo di = new DirectoryInfo(sFtpPath);
di.Delete(true);

I have even successfully removed the virtual directory from the FTP site
that references this path but I can't seem to find a way to kick a user out
of the directory or terminate his session.

Does anyone have a pointer on this? I haven't been able to find any good
threads on ftp session management or ending a user's session with the box.

Regards,
Jason
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top