5

I realize that this is essentially this question, but it's accepted answer just points to a link that doesn't seem to do what the asker requested (it doesn't start from ResourceManager/ResourceSet).

Is there any way to do this?

Community
  • 1
  • 1
ChaseMedallion
  • 20,860
  • 17
  • 88
  • 152

3 Answers3

-1

To get the resource content use:

            ResourceReader rr = new ResourceReader(Assembly.GetExecutingAssembly().GetManifestResourceStream("resourceName"););

            IDictionaryEnumerator e = rr.GetEnumerator();
            string resourceType;

            byte[] resourceData;
            while (e.MoveNext())
            {
                string keyName = (string)e.Key;

                rr.GetResourceData(keyName, out resourceType, out resourceData);
            }
  • 1
    When I run this, this only gives me ResourceTypeCode.String and the actual resource value. I don't get the resource comment. How do you get the comment? – ChaseMedallion Sep 17 '13 at 19:44
-1

The only thing I could currently think of, is if your read the .resx file with an xml reader.

Remy
  • 12,555
  • 14
  • 64
  • 104
-1

From this article : GetManifestResourceStream returns NULL

        string[] array = this.GetType().Assembly.GetManifestResourceNames();
        string[] array2 = Assembly.GetExecutingAssembly().GetManifestResourceNames();

Will help you to get resource name.

Community
  • 1
  • 1
  • This returns the list of resource file names in the assembly, not the comments associated with resource keys in .resx files – ChaseMedallion Jul 26 '15 at 20:59