I want to loop through my javascript files. In the global.asax file on application start, I have this:
void Application_Start(object sender, EventArgs e)
{
//bugs this line
System.IO.DirectoryInfo info = new System.IO.DirectoryInfo("\\Scripts");
StringBuilder sb = new StringBuilder();
foreach (var item in info.GetFiles("*.js"))
{
sb.Append(System.IO.File.ReadAllText(item.FullName));
sb.Append(Environment.NewLine);
}
}
However, it's not working, it says it can't find files. How do I programmatically get to a directory and its files?
Thanks for your suggestions.