If your class is static class then use this methods:
internal static string GetFromResources(string resourceName)
{
Assembly assem = Assembly.GetExecutingAssembly();
using (Stream stream = assem.GetManifestResourceStream(assem.GetName().Name + '.' + resourceName))
{
using (var reader = new StreamReader(stream))
{
return reader.ReadToEnd();
}
}
}
For example if your embedded resource file names on the this project is 'MyFile.txt' then use this static method same this code:
var myFileData = GetFromResources("MyFile.txt");