Skip to content

Instantly share code, notes, and snippets.

@chardcastle
Created March 28, 2011 14:12
Show Gist options
  • Save chardcastle/890531 to your computer and use it in GitHub Desktop.
Save chardcastle/890531 to your computer and use it in GitHub Desktop.
File an xml file locally off disk
/*
* Read the Homepage XML file and get the snippets
* from file
*/
public List<string> get_homepage_snippets()
{
List<string> snippets = new List<string>();
XmlTextReader reader = new XmlTextReader(Server.MapPath("~/Data/homepage.xml"));
while (reader.Read())
{
if (reader.Name.Equals("snippet") == true)
{
snippets.Add(reader.ReadString());
}
}
return snippets;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment