Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * Created by SharpDevelop.
- * User: MegaTron
- * Date: 3/24/2015
- * Time: 12:08 PM
- *
- * To change this template use Tools | Options | Coding | Edit Standard Headers.
- */
- using System;
- namespace proyecto002
- {
- class Program
- {
- public static void Main(string[] args)
- {
- Console.WriteLine("Hello World!");
- // TODO: Implement Functionality Here
- string nombre;
- int numero;
- Console.Write("Press any key to continue . . . ");
- Console.ReadKey(true);
- try
- {
- Console.Write("Escriba su nombre ");
- nombre=Console.ReadLine();
- Console.WriteLine("Escriba un numero ");
- numero=Convert.ToInt32(Console.ReadLine());
- if ( nombre.Equals("") == true)
- {
- throw new ArgumentException("No puede tener una cadena vacia ");
- }
- }
- catch ( ArgumentException ex )
- {
- Console.Write(ex.Message);
- }
- catch ( FormatException fe)
- {
- Console.Write(fe.Message);
- }
- Console.ReadKey(true);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement