摘要:
1、string path = Environment.GetFolderPath(Environment.SpecialFolder.Programs);
2、string path = Environment.GetEnvironmentVariable("ALLUSERSPROFILE");
3、[DllImport("shell32.dll")]
static extern bool SHGetSpecialFolderPath(IntPtr hwndOwner,[Out] StringBuilder lpszPath, int nFolder, bool fCreate);
const int CSIDL_PROGRAMS = 2; // \Windows\Start Menu\Programs
StringBuilder pathBuilder = new StringBuilder(260);
SHGetSpecialFolderPath(IntPtr.Zero, pathBuilder, CSIDL_PROGRAMS, false);
string 阅读全文