Attualità e Information Technology

September 21, 2006

Convertire una stringa in un Enum

Filed under: IT, .NET

Dal buon Mura:

enum Colour
{
Red,
Green,
Blue
}

// …
Colour c = (Colour) Enum.Parse(typeof(Colour), “Red”, true);

Technorati tags , ,

AddThis Social Bookmark Button
   

Get free blog up and running in minutes with Blogsome | Theme designs available here