Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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,

share|improve this question
    
what you mean by module? –  Amit Kumawat Dec 1 '11 at 16:57
add comment

2 Answers 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.

share|improve this answer
add comment

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);
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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