Posted By

denakitan on 10/20/12


Tagged

Net basics resources examples c#


Versions (?)

Who likes this?

3 people have marked this snippet as a favorite

craig
Priestd09
danfinrud55


.NET - C# - Resources - Basics


 / Published in: C#
 

Basic examples on using information stored as Resources.

  1. using System.Resources;
  2. using System.Drawing;
  3. using System.Reflection;
  4.  
  5. namespace StudioGhibli
  6. {
  7. class ResourcesExample
  8. {
  9. static void Main(string[] args)
  10. {
  11. // the first parameter of the constructor is the fully qualified name of the resources file
  12. ResourceManager resourceManager = new ResourceManager("StudioGhibli.MoviesResources", Assembly.GetExecutingAssembly());
  13. Bitmap image = (Bitmap) resourceManager.GetObject("TotoroLogo");
  14. image.Save(@"H:\apps\xp\Desktop\Totoro.jpg");
  15. }
  16. }
  17. }

Report this snippet  

You need to login to post a comment.