using System;using System.Resources;using System.Collections;
public class MainClass { public static void DisplayName(string resName) { try { ResourceReader MyResourceReader = new ResourceReader(resName + ".resources"); IDictionaryEnumerator MyKeysdict = MyResourceReader.GetEnumerator(); while (MyKeysdict.MoveNext()) { string MyString = (string)MyKeysdict.Key; if (MyString == "Nathan") Console.WriteLine("{0}", MyKeysdict.Value); } } catch (Exception e) { Console.WriteLine("Exception where reading the resource {0}", e); return; } } public static void Main(string[] args) { DisplayName(args[0]); }}