.NET - C# - Resources - Basics


/ Published in: C#
Save to your folder(s)

Basic examples on using information stored as Resources.


Copy this code and paste it in your HTML
  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


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.