Using Environment.SpecialFolder to get the files of MyPictures folder

We can use the Environment.SpecialFolder enum in .NET to locate special folders like MyDocuments, MyPictures, MyMusic, MyComputer, Fonts, History, Desktop, Programs, StartMenu, Startup, and so on… We can see all of them in the Environment.SpecialFolder IntelliSense.

        Dim theFiles As String()
        theFiles = Directory.GetFiles(Environment.GetFolderPath(Environment.SpecialFolder.MyPictures), "*", SearchOption.AllDirectories)
        Dim i As Integer
        For i = 0 To (theFiles.Length - 1)
            Console.WriteLine(theFiles(i).ToString())
        Next

Comments

Popular posts from this blog

C# code to Check IE Proxy Settings

Convert XElement to DataTable