3

I have a custom timer job by which I need to create custom properties using an xml file (which has all the custom properties). As for the xml file, I'm thinking to create a module for it. And then let the timer job read this XML file from the 14 hive

Please anyone let me know how to read the xml file from the 14 hive

Thanks,

1
  • what you mean by module? Dec 1, 2011 at 16:57

2 Answers 2

2

If you use Module, the file accessible by the URL. You should only activate feature that is installs this module to a web. After this you can use SPWeb.GetFile method.

0

Here is a simple code to retrieve an xml document from the hive:

var path = SPUtility.GetGenericSetupPath("FileName.xml");
var text = GetContent(path);
content = System.IO.File.ReadAllText(path);
var doc = new XmlDocument();
doc.LoadXml(text);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.