Folders

Ok. I would like to know how to search folders on my computer, then display them in some type of window in my program. Can someone tell me what object to use please.


Answer this question

Folders

  • DavePS

    Ok. Thank you. Can you tell me how to show the folders in some type of window

  • Alexandra Muller

    Hi,

    If you mean regular directories on your system then you can use the Directory class from System.IO namespace. Here is some sample code below:

    string []strDrives = Environment.GetLogicalDrives();

    string []strDirectories = null;

    foreach (string strDrivename in strDrives)

    {

    if (strDrivename != @"A:\")

    strDirectories = Directory.GetDirectories(strDrivename, "T*");

    }

    This code retrieves all folders starting with T.

     

    Regards,

    Vikram

     



  • Folders