Hola amigos.
alguien me podría enseñar como poner un mensaje personalizado y borrar el resto que aparece en la consola?.-
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
class OverFlowTest
{
static byte x = 250;
static byte y = 10;
static int metodoChecked()
{
int z = 0;
try
{
z = checked((byte)(x + y));
}
catch (System.OverflowException e)
{
Console.WriteLine(e.ToString());
}
return z;
}
static void Main()
{
Console.WriteLine("El valor de z es: {0}", metodoChecked());
Console.ReadLine();
}
}
Abrazo Armando.-
Un saludo a todos.-
Daniel
Hola.
Evidentemente me apuré un tanto.-
catch (System.OverflowException e)
{
Console.WriteLine("Error");
//Console.WriteLine(e.ToString());
}
Saludos.
Daniel