Skip to content

Instantly share code, notes, and snippets.

@Fhernd
Created September 21, 2013 06:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Fhernd/6647973 to your computer and use it in GitHub Desktop.
Save Fhernd/6647973 to your computer and use it in GitHub Desktop.
Clase que contiene métodos utilitarios para una aplicación tipo consola en C#.
using System;
namespace OrtizOL.Recetas.Capitulo01
{
public class Utilidades
{
// Solicita al usuario ingresar un dato desde la entrada estándar.
public static string LeerCadena(string mensaje)
{
Console.Write(mensaje);
return Console.ReadLine();
}
// Muestra mensaje en la salida eständar.
public static void EscribirCadena(string mensaje)
{
Console.WriteLine(mensaje);
}
// Punto de entrada a la aplicaciön.
public static void Main()
{
// Mensaje de solicitud de entrada
string nombre = LeerCadena ( "Ingrese su nombre: ");
// Mensaje de bienvenida
EscribirCadena("Bievenido al blog OrtizOL, " + nombre;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment