/
aprogrammer
/
dotnet-docs
Обзор
Документация
Войти
/
aprogrammer
/
dotnet-docs
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
samples/snippets/visualbasic/VS_Snippets_CLR_System/system.io.enumdirs1/vb/program.vb
25 строк
769 B
Andy De George
Move snippets from samples repo to this repo (#17296)
03 мар 2020, 19:23
Не верифицирован
03 мар 2020, 19:23
dbbeda1
Код
Авторство
О чём код?
' <Snippet1> Imports System.Collections.Generic Imports System.IO Module Module1 Sub Main() Try Dim dirPath As String = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) Dim dirs As List(Of String) = New List(Of String)(Directory.EnumerateDirectories(dirPath)) For Each folder In dirs Console.WriteLine($"{dir.Substring(dir.LastIndexOf(Path.DirectorySeparatorChar) + 1)}") Next Console.WriteLine($"{dirs.Count} directories found.") Catch ex As UnauthorizedAccessException Console.WriteLine(ex.Message) Catch ex As PathTooLongException Console.WriteLine(ex.Message) End Try End Sub End Module ' </Snippet1>