C# Time of finally execution

后端 未结 9 1605
情话喂你
情话喂你 2021-02-04 01:37

Take this code:

using System;

namespace OddThrow
{
    class Program
    {
        static void Main(string[] args)
        {
            try
            {
              


        
9条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-02-04 02:07

    A try/finally without a catch will use the default handler which does exactly what you see. I use it all the time, e.g., in cases where handling the exception would be covering an error but there's still some cleanup you want to do.

    Also remember that output to standard error and standard out are buffered.

提交回复
热议问题