Save and read value from resx resource file : Resource ResX : Development Class C# Source Code


Custom Search

C# Source Code » Development Class » Resource ResX »

 

Save and read value from resx resource file








    


  using System;
  using System.Resources;
  using System.Drawing;
  using System.Collections;
  using System.Windows.Forms;
  using System.Resources;

  class ResourceGenerator
  {
    static void Main(string[] args)
    {
      ResXResourceWriter w = new ResXResourceWriter("ResXForm.resx");
      Image i = new Bitmap("winter.jpg");
      w.AddResource("myImage", i);
      w.AddResource("welcomeString", "www.navioo.com");
      w.Generate();
      w.Close();        
        
      // Make a resx reader.
      ResXResourceReader r = new ResXResourceReader("ResXForm.resx");
      
      IDictionaryEnumerator en = r.GetEnumerator();
      while (en.MoveNext()) 
      {
        Console.WriteLine("Value:" + en.Value.ToString(), "Key: " + en.Key.ToString());
      }
      r.Close();
    }
  }

           
       
    
   
  
   







HTML code for linking to this page:

Follow Navioo On Twitter

C# Source Code

 Navioo Development Class
» Resource ResX