Click to Rate and Give Feedback
MSDN
MSDN Library
Visual Studio .NET
Samples
 Code: Finding the Names of Resource...
Visual C# Language Concepts
Code: Finding the Names of Resources in an Assembly (Visual C#)

This example creates a string that contains the names of all the resources in an assembly.

Example

System.Reflection.Assembly thisExe; 
thisExe = System.Reflection.Assembly.GetExecutingAssembly();
string [] resources = thisExe.GetManifestResourceNames();
string list = "";

// Build the string of resources.
foreach (string resource in resources)
   list += resource + "\r\n";

Compiling the Code

Copy the code and paste it into the Main method of a console application.

See Also

Assembly Class | General Language Example Topics

© 2012 Microsoft. All rights reserved. Terms of Use | Trademarks | Privacy Statement
Page view tracker