Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Placing network folder contents into a drop down menu 2

Status
Not open for further replies.

jheiser

Programmer
Dec 19, 2003
14
US
I have a VB asp.net project going. I need to take the contents of a specific network folder and place the results into a drop down menu. Does anyone know how to do this?
 
ASP.Net questions are better asked on the ASP.Net forum. The VB.Net forum focuses more so on Windows based development.

As for your project, check out the System.IO namespace. Specificly the File and Directory objects. You should be able to get an array of file names from a Directory object and add them to the combo box's item list.

-Rick

VB.Net Forum forum796 forum855 ASP.NET Forum
[monkey]I believe in killer coding ninja monkeys.[monkey]
 
What do you mean by the contents of a folder? The file names?

If that's the case, use the IO namespace

Dim fileName As String
Dim files As String()
Dim dirApp As String = "\\servername\path\"
files = IO.Directory.GetFiles(dirApp, "*.txt")

For Each fileName In files
RunSomeScript(fileName)
Next

If you want to get all files in the directory clear the "*.txt" from the GetFiles Parameters.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top