使用 run as 时的 C# window xp 当前用户 [英] C# window xp current user when using run as
问题描述
有什么办法可以让当前使用 run as 命令的用户在 windows xp 上运行我的应用程序?我有一个必须以管理员身份运行的应用程序,但我需要能够告诉启动该应用程序的用户在他们的桌面上放置快捷方式.
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.
我试过 environment.getcurrentuser() 甚至直接调用 windows api 但不幸的是那些只告诉我线程的所有者而不是当前登录的用户.
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.
推荐答案
我使用的解决方法是在公共桌面上放置快捷方式,以便每个人都能使用.基本上我希望有一种方法可以只使用公共桌面.我将继续并将其作为答案,但如果其他人提出解决方案,我会将其标记为答案.
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.
这篇关于使用 run as 时的 C# window xp 当前用户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!