如何获得在C%AppData的%文件夹? [英] How to get the %AppData% folder in C?
问题描述
如上,如何用C我得到AppData文件夹在Windows?
As above, how do I get the AppData folder in Windows using C?
我知道,C#使用 Environment.SpecialFolder.ApplicationData code>
推荐答案
使用 SHGetSpecialFolderPath 与 CSIDL设定所需的文件夹(大概CSIDL_APPDATA或CSIDL_LOCAL_APPDATA)。
Use SHGetSpecialFolderPath with a CSIDL set to the desired folder (probably CSIDL_APPDATA or CSIDL_LOCAL_APPDATA).
您也可以使用新的的SHGetFolderPath()和< A HREF =http://msdn.microsoft.com/en-us/library/bb762181%28VS.85%29.aspx> SHGetKnownFolderPath()的功能。
还有 SHGetKnownFolderIDList(),如果你喜欢COM有<一个href=\"http://msdn.microsoft.com/en-us/library/bb761762%28VS.85%29.aspx\">IKnownFolder::GetPath().
You can also use the newer SHGetFolderPath() and SHGetKnownFolderPath() functions. There's also SHGetKnownFolderIDList() and if you like COM there's IKnownFolder::GetPath().
这篇关于如何获得在C%AppData的%文件夹?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!