如何在C#线程中指定用户 [英] How to specify the user in a C# Thread

查看:108
本文介绍了如何在C#线程中指定用户的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何从应用程序 A 生成线程 T ,以便该应用程序A的用户是 U1 (就像我一样),但是线程T的用户是 U2 (像超级用户一样)吗?

how can I spawn the thread T from application A so that that application A's user is U1 (like me) but thread T's user is U2 (like a superuser)?

谢谢

推荐答案

看看属性Thread.CurrentPrincipal的示例代码:

Have a look at the example code for the property Thread.CurrentPrincipal:

http://msdn.microsoft.com /en-us/library/system.threading.thread.currentprincipal.aspx

这篇关于如何在C#线程中指定用户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆