Get the resources

We can find our resources used in our projects.
The following code will display all the resources which are used in our project

System.Reflection.Assembly MyExe;
MyExe = System.Reflection.Assembly.GetExecutingAssembly();
string[] Myresources = MyExe.GetManifestResourceNames();

foreach (string resource in Myresources)
Console.WriteLine(resource + "\r\n");

Code Explanation.

1. Create an instance of Assembly.
2. Get the resources using Reflection.
3. Store the resources into the sting array.
4. Display all the resources



No responses found. Be the first to comment...

  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name: