Check the key in a .resources file : ResourceReader : GUI Windows Form C# Source Code


Custom Search

C# Source Code » GUI Windows Form » ResourceReader »

 

Check the key in a .resources file








    


using System;
using System.Resources;
using System.Collections;

public class MainClass {
    public static void DisplayGreeting(string resName) {
        try {
            ResourceReader reader = new ResourceReader(resName + ".resources");
            IDictionaryEnumerator dict = reader.GetEnumerator();
            while (dict.MoveNext()) {
                string s = (string)dict.Key;
                if (s == "Greeting")
                    Console.WriteLine("{0}", dict.Value);
            }
        } catch (Exception e) {
            Console.WriteLine("Exception creating manager {0}", e);
            return;
        }
    }

    public static void Main(string[] args) {
        DisplayGreeting(args[0]);
    }
}

           
       
    
   
  
   







HTML code for linking to this page:

Follow Navioo On Twitter

C# Source Code

 Navioo GUI Windows Form
» ResourceReader