Display list of all pages in a Virtual Directory C#

I'm looking for a way to populate a listbox with all the pages found in a vitual directory.

The UI will have an entry for the user to enter the path (e.g. http://servername.domain.com/path), I then need to get ll pages and sub folders within tis directory.

Does anyone know if this is possible?

Thanks
LVL 1
wint100Asked:
Who is Participating?
 
MikeQcConnect With a Mentor Commented:
System.IO.Directory.GetFiles(physicalPath, "*.html")
System.IO.Directory.GetFiles(physicalPath, "*.aspx")
0
 
MikeQcCommented:
That is relatively simple.
Use Server.MapPath("http://servername.domain.com/path").
This will return the physical path on the server.
From that you could do a search for all the .aspx, .html of the path and populate your listbox.
0
 
wint100Author Commented:
From that you could do a search for all the .aspx, .html of the path and populate your listbox.

What search parameters should I use? Do you have any example code?
0
 
wint100Author Commented:
This doesn't seem to work in silverlight, I'll have to try a similar approach that is silverlight friendly.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.