Advertisement
Guest User

Untitled

a guest
May 24th, 2019
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.24 KB | None | 0 0
  1. private static void DeleteFileIfExists(string filePath)
  2. {
  3. if (File.Exists(filePath))
  4. {
  5. File.Delete(filePath);
  6. }
  7. if (File.Exists(filePath))
  8. {
  9. throw new Exception("The file exists after trying to delete it.");
  10. }
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement