示例#1
0
        static void Main(string[] args)
        {
            try
            {
                OtraClase n = new OtraClase();
                n.OtroMetodoDeInstancia();
            }
            catch (Exception ex) //(MiExcepcion ex)
            {
                Console.WriteLine(ex.Message);
                while (ex.InnerException != null)
                {
                    ex = ex.InnerException;
                    Console.WriteLine(ex.Message);
                }

                /*
                 * Exception inneer = ex.InnerException;
                 * Console.WriteLine(ex.Message);
                 * while (inneer != null)
                 * {
                 *  Console.WriteLine(inneer.Message);
                 *  inneer = inneer.InnerException;
                 * }*/
            }
            Console.ReadKey();
        }