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
 
Back
Top