public static ForceDeleteFile ( string path ) : void | ||
path | string | |
return | void |
public static void ForceDeleteFile(string path)
{
if (File.Exists(path))
{
using (FileStream stream = new FileStream(path, FileMode.Open, FileAccess.Read))
{
stream.Dispose();
}
File.Delete(path);
}
}