Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private static void DeleteFileIfExists(string filePath)
- {
- if (File.Exists(filePath))
- {
- File.Delete(filePath);
- }
- if (File.Exists(filePath))
- {
- throw new Exception("The file exists after trying to delete it.");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement