Opening the user's home folder?
My XULRunner application has a button named "Show Recordings". Pressing it should result in Windows Explorer opening the folder for the user. How can I achieve this?
I can't find it 开发者_JAVA技巧in the File I/O documentation, perhaps I'm looking in the wrong place.
Edit The problem is not finding the path, but telling the system to open the folder. I can't seem to find a "openFolder" function.
You're looking for the reveal()
method on nsILocalFile.
Do you mean:
%HOMEPATH%
And by that I mean, if you want a global variable to get the current user's home directory path, use %HOMEPATH%. I guess you have to set that button to this value. For a list of Windows environment variables, start at the wiki article.
精彩评论