We help IT Professionals succeed at work.

accessing and displaying a directory on a server

Easyrider43
Easyrider43 asked
on
whats the best way to access  and display a directory using visual basic forms, Im new to visual basic so please be gentle :)

Comment
Watch Question

Most Valuable Expert 2012
Top Expert 2008

Commented:
I can't suggest the "best way", but I can suggest a "good way".  Are you looking for advice on the UI, code, or both?  Are you trying to figure out how to use VB.NET?  Are you looking for a Windows Explorer-like UI experience with a TreeView?

Author

Commented:
A "good way" works I just want to display files located in a certian folder that is located on my server. I think I want to use a text box and just load the file names in there and if I want to use one of those files I can just click that file?? Thanks
Most Valuable Expert 2012
Top Expert 2008
Commented:
If you want to display file names from a folder that the web site has access to, then you should be able to use the System.IO.Directory.GetFiles method, and then build a string that you can set the TextBox.Text to.  If you have a virtual directory, then you can use the Server.MapPath to convert the logical file path to a physical file path that GetFiles requires.