I'm trying to test to see if the code works (and obviously it doesn't)
The plan is to have a look at whatever files are in so-and-so folder and turn their names into an array of string arguments that I can tape onto whatever directory the website is in.
problem is, unless I hard-code the directory and TELL it where to look, it gets it wrong every time. The error message is telling me (if I'm reading it right) that it's looking for the folder in c:/Program Files/Visual Studio/etc/etc/etc but the website is in c:/Documents and settings/etc/etc/etc. How to I tell it to grab the path that the website is working out of?
* I have tried using "~/Photos" (error msg above)
* I have tried Page.ResolveUrl
* I have tried some other thing I can't even remember in Request.Something that only threw an HTTP Exception at me
Somebody PLEASE HELP!!!
BTW this is the most recent failed attempt:
protected void Page_Load(object sender, EventArgs e)
Default2 thisPage = new Default2();
FileInfo picNames = thisPage.makeArray("~/Photos/Portrait");
public FileInfo makeArray(string path)
string myPath = Page.ResolveUrl(@path)
DirectoryInfo picsNum = new DirectoryInfo(myPath);
FileInfo files = picsNum.GetFiles("*.jpg");
Ideally this should be re-usable (I might make a new class in the master.aspx.cs called ImageToys or something to that effect)