Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

VB .net problem

Options
  • 18-11-2004 6:46pm
    #1
    Registered Users Posts: 245 ✭✭


    I have a piece of code that allows me to use a OpenFileDialog to add files (and their paths) to a list box. (i.e. c:\temp\word.doc). Thats fine. However, i'd also like to be able to just add folders to this list not just files (i.e just add c:\temp to the list). Anyone know how i can do this.... Any help greatly appreciated...

    Cheers, P.


Comments

  • Registered Users Posts: 834 ✭✭✭fragile


    Use the FolderBrowserDialog class, or there is a .NET function which will extract a folder from a fully qualified
    file path. It is:

    FileInfo fInfo = new FileInfo("D:\\Downloads\\Kazaa\\myFile.txt");

    Make sure to add System.IO to
    your imports.

    HTH


  • Registered Users Posts: 245 ✭✭Polonious


    Nice one thanks, thats exactly what i needed. Where can i find a list of classes?


  • Registered Users Posts: 834 ✭✭✭fragile


    Polonious wrote:
    Nice one thanks, thats exactly what i needed. Where can i find a list of classes?
    here

    or if you are using Visual Studio .NET you should have a copy of the MSDN (Microsoft Developer Documentation) DVD which menas you can install all the MSDN stuff locally, which is a lot more convenient than using it online


Advertisement