Environment - GetFolderPath
Gets the path to the system special folder that is identified by the specified enumeration.
public static void Main() { const Environment.SpecialFolder specialFolder = Environment.SpecialFolder.StartMenu; // C# Extension Method: Environment - GetFolderPath string path = specialFolder.GetFolderPath(); Console.WriteLine(path); }
View Source
using System; public static partial class Extensions { /// <summary>An Environment.SpecialFolder extension method that gets folder path.</summary> /// <param name="this">this.</param> /// <returns>The folder path.</returns> public static string GetFolderPath(this Environment.SpecialFolder @this) { return Environment.GetFolderPath(@this); } /// <summary>An Environment.SpecialFolder extension method that gets folder path.</summary> /// <param name="this">this.</param> /// <param name="option">The option.</param> /// <returns>The folder path.</returns> public static string GetFolderPath(this Environment.SpecialFolder @this, Environment.SpecialFolderOption option) { return Environment.GetFolderPath(@this, option); } }