C# Referencing List Items with Both Indexes and Strings

Defining an indexer allows you to create classes that act like “virtual arrays.” Instances of that class can be accessed using the [] array access operator. Examples include Settings[0] or Settings["ComputerID"]. See the code below:

Another option is an extension method. Call it like Settings.GetByName("ComputerID"):