windows特殊路径获得

DWORD GetEnvironmentVariable(
  LPCTSTR lpName,  // environment variable name
  LPTSTR lpBuffer, // buffer for variable value
  DWORD nSize      // size of buffer
);
lpName为环境变量名称,如“userprofile”可得到%userprofile%地址。

DWORD GetTempPath(
  DWORD nBufferLength,  // size of buffer
  LPTSTR lpBuffer       // path buffer
);
获取Temp路径,也可以由GetEnvironmentVariable函数使用环境变量“Temp”获取。

posted on 2012-11-17 09:13  Ricky.yi  阅读(203)  评论(0编辑  收藏  举报

导航