问题
Is there any way to get the current user who used the run as command to run my applcation on windows xp? I have an application that must be run as an administrator but I need to be able to tell the user who started the application for putting short cuts on their desktop.
I have tried environment.getcurrentuser() and even doing a direct called to the windows api but unfortunately those only tell me the owner of the thread and not the currently logged in user.
回答1:
The work around that I used was to place short cuts on the public desktop so everyone gets it. Basically I was hoping for a way around just using the public desktop. I am going to go ahead and put this down as the answer but if anyone else comes up with a solution I will mark it as the answer.
来源:https://stackoverflow.com/questions/21641707/c-sharp-window-xp-current-user-when-using-run-as