I'm trying to open a file from a USB-Drive in my c# application. I handle the IOException in C# If the file is corrupted. Unfortunately also Windows 10 is showing a message box which I want to suppress.
try
{
// Open file and read all lines to trigger the exception if file is bad
string[] lines = File.ReadAllLines(s);
}
catch (IOException e)
{
// Corrupted File found Execute CHKDSK on that drive
}
C# is handling the exception as expected. But Windows is showing the following message:
Is there a way to suppress the Windows warning window? Thanks for your help.