Embedded XML File

  • Thread starter Thread starter Tim
  • Start date Start date
T

Tim

Hi,

I have a XML file the I use as config file for a libary. Is there a way to
use reflection to access the file using XMLReader?

Thanks
 
Hi,

I have a XML file the I use as config file for a libary. Is there a
way to use reflection to access the file using XMLReader?

Did you embed the file as a local resource?
 
private Assembly thisAssembly;
public void MethodName(string name)
{
if (thisAssembly == null)
{
thisAssembly = GetType().Assembly;
}
// Here is the resource stream
Stream s = thisAssembly.GetManifestResourceStream(name);
}

Regards,

Bela Istok
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top