I’m referring to C# – How to get current user picture but I never found a solution. (I’m working on Win7 OS)
For some users, the picture is located on
C:\Users\UserName\AppData\Local\Temp\UserName.bmp
(where UserName is user nickname) for others users this path throws FileNotFoundException but pictures exists.
Where I can find information about the path or real picture? There is a registry that contains this information?
This blog post shows how to set the user tile (picture). In a comment near the end (Michael Anthony, Apr 10, 22:45), the commenter describes how to get the picture. I’ve gathered the info into a C# snippet. Remember that this is based on an undocumented Windows Shell function.
Note that this Shell function creates the file \Users\<USER>\AppData…\<USER>.bmp and returns its filename.
Also, I’ve tested it on Win7. I have no idea of its compatibility with former Windows versions.
Credits to Joco and Michael Anthony.