Find all directories in directory and return only name

后端 未结 5 1041
无人及你
无人及你 2020-12-21 11:37

I want to find all directories in one directory in vb.net.

I found one script:

For Each Dir As String In Directory.GetDirectories(FolderName)
    Com         


        
5条回答
  •  盖世英雄少女心
    2020-12-21 12:17

    I think the easiest way would be using String.Replace to remove FolderName from the beginning of the directory full name.

    For Each Dir As String In System.IO.Directory.GetDirectories(FolderName)
        ComboBox3.Items.Add(Dir.Replace(FolderName, String.Empty))
    Next
    

提交回复
热议问题