TCHAR str_all_user_path[MAX_PATH]={0};
TCHAR str_full_path[MAX_PATH]={0};
GetEnvironmentVariable(_T("ALLUSERSPROFILE"),str_all_user_path,MAX_PATH);
_stprintf(str_full_path,_T("%s\\updata"),str_all_user_path);
CreateDirectory(str_full_path,NULL);
_stprintf(str_full_path,_T("%s\\updata\\%s"),str_all_user_path,str_file_name);
OutputDebugStringA("all user path is:");
OutputDebugString(str_full_path);
本文介绍了如何使用C/C++编程语言获取系统环境变量并创建特定的用户更新文件夹路径。通过调用GetEnvironmentVariable函数获取ALLUSERSPROFILE环境变量,并利用此路径创建名为updata的目录。

被折叠的 条评论
为什么被折叠?



