c# get user picture folder code example

Example: c# how to get current user picture folder

// Sample for the Environment.GetFolderPath method
using System;

class Sample
{
    public static void Main()
    {
      // Gets the current user Pictures folder
    Console.WriteLine("GetFolderPath: {0}",
                 Environment.GetFolderPath(Environment.SpecialFolder.MyPictures));
      
      using (OpenFileDialog ofd = new OpenFileDialog())
            {
        // When its open it will open the picture folder
                ofd.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyPictures);
            }
    }
}
/*
This example produces the following results:

GetFolderPath: C:\WINNT\System32
*/