# Accessing Embedded Resources
The following code can be used to access embedded resources:
```csharp
using System.IO;
using System.Reflection;
var assembly = Assembly.GetExecutingAssembly();
var resourceName = "MyCompany.MyProduct.MyFile.txt";
using (Stream stream = assembly.GetManifestResourceStream(resourceName))
using (StreamReader reader = new StreamReader(stream))
{
string result = reader.ReadToEnd();
}
```
The `resourceName` is composed of the name of the file (`MyFile.txt`), together with the assembly name. The build action of the file must be set to `Embedded Resource`.
You can get a list of all embedded files in an assembly using the assembly's `GetManifestResourceNames` method.