List items in a folder

  • Thread starter Thread starter James Rasmussen
  • Start date Start date
J

James Rasmussen

I would like to be able to list a directory (or something like it)of the
contance of a certian folder. How can this be done on a web page?
TIA
Jim
 
This is how you can do that with listbox web control, consider lstFileName
as listbox

Dim oDirectoryInfo As DirectoryInfo
oDirectoryInfo = New DirectoryInfo(hdnDirName.Value)
lstFileName.DataSource = oDirectoryInfo.GetFiles("*.resources")
lstFileName.DataTextField = "Name"
lstFileName.DataValueField = "Name"
lstFileName.DataBind()
 
Back
Top