3
My teacher passed a series of exercises and in them I need to create a code to give the error AccessViolationException
. However I am not able to create a code that of this error (I am not willing to make the error treatment).
I need something to insert into the try
.
try{
//código que retorna o erro
}catch(AccessViolationException ex){
Console.WriteLine(ex);
}
Gives a
System.IO.Directory.DeleteDirectory("C:\\Windows\\System32");
and you’ll have aAccessViolationException
(and other little surprises).– CypherPotato