Have you ever noticed that throw command behaves somewhat differently in VB.NET and C#? See the following two code parts. It's the same thing written in VB.NET and C#. DummyMethod throws an exception (line 12) that is caught by a try/catch statement in the Main method. Line 7 writes the exception into the console window. 1: static void Main( string [] args) { 2: try 3: { DummyMethod(); } 4: catch (Exception ex) 5: { Console.WriteLine(ex); 6: } 7: Console.ReadKey(); 8: } 9: 10: private static void DummyMethod()
Διαβάστε περισσότερα »