using System;
namespace Articulo.Pregunta.R1520
{
public enum Autenticacion
{
FORMULARIO = 1,
WINDOWS = 2,
WEB = 3
}
public class StringEnumeracion
{
public static void Main()
{
// Por medio de GetName(Type, object):
Autenticacion autFormulario = Autenticacion.FORMULARIO;
string strAutFormulario = Enum.GetName(typeof(Autenticacion), autFormulario);
Console.WriteLine ("\nGetName(Type, object): {0}\n", strAutFormulario);
// Por medio de ToString():
Console.WriteLine ("ToString(): {0}\n", autFormulario.ToString());
}
}
}
dXNpbmcgU3lzdGVtOwoKbmFtZXNwYWNlIEFydGljdWxvLlByZWd1bnRhLlIxNTIwCnsKICAgIHB1YmxpYyBlbnVtIEF1dGVudGljYWNpb24KICAgIHsKICAgICAgICBGT1JNVUxBUklPID0gMSwKICAgICAgICBXSU5ET1dTID0gMiwgCiAgICAgICAgV0VCID0gMwogICAgfQogICAgCiAgICBwdWJsaWMgY2xhc3MgU3RyaW5nRW51bWVyYWNpb24KICAgIHsKICAgICAgICBwdWJsaWMgc3RhdGljIHZvaWQgTWFpbigpCiAgICAgICAgewogICAgICAgICAgICAvLyBQb3IgbWVkaW8gZGUgR2V0TmFtZShUeXBlLCBvYmplY3QpOgogICAgICAgICAgICBBdXRlbnRpY2FjaW9uIGF1dEZvcm11bGFyaW8gPSBBdXRlbnRpY2FjaW9uLkZPUk1VTEFSSU87CiAgICAgICAgICAgIHN0cmluZyBzdHJBdXRGb3JtdWxhcmlvID0gRW51bS5HZXROYW1lKHR5cGVvZihBdXRlbnRpY2FjaW9uKSwgYXV0Rm9ybXVsYXJpbyk7CiAgICAgICAgICAgIENvbnNvbGUuV3JpdGVMaW5lICgiXG5HZXROYW1lKFR5cGUsIG9iamVjdCk6IHswfVxuIiwgc3RyQXV0Rm9ybXVsYXJpbyk7CiAgICAgICAgICAgIAogICAgICAgICAgICAvLyBQb3IgbWVkaW8gZGUgVG9TdHJpbmcoKToKICAgICAgICAgICAgQ29uc29sZS5Xcml0ZUxpbmUgKCJUb1N0cmluZygpOiB7MH1cbiIsIGF1dEZvcm11bGFyaW8uVG9TdHJpbmcoKSk7CiAgICAgICAgfQogICAgfQp9