SHGetSpecialFolderLocation (shell32)
Last changed: -202.74.138.1

.
Summary

C# Signature:

[DllImport("shell32.dll", SetLastError = true)]
static extern int SHGetSpecialFolderLocation(IntPtr hwndOwner, CSIDL nFolder,
   ref IntPtr ppidl);

User-Defined Types:

CSIDL

Notes:

None.

Tips & Tricks:

Please add some!

Sample Code:

Please add some!

Alternative Managed API:

Do you know one? Please contribute it!

Documentation

    'In Visual Basic.Net

    Dim fileP As String
    fileP = My.Computer.FileSystem.SpecialDirectories.MyDocuments

    MsgBox(fileP.ToString)

    // In C# after adding a Reference to the Microsoft.VisualBasic.dll
    using Microsoft.VisualBasic.Devices;

    // and in the Code
    Computer c = new Computer();
    MessageBox.Show(c.FileSystem.SpecialDirectories.MyDocuments);