Ben*_*307 5 .net c# impersonation dllimport advapi32
我使用advapi32.dll的logonuser方法通过我们的网络访问数据. 我知道它将线程的用户改为我给它的信息,但我想知道是否有办法扭转它. 我想访问数据,然后返回本地用户凭据.
Uwe*_*eim 7
前段时间我创建了一个小模仿课程.
基本上你将代码包装在一个using块内的另一个用户下执行 :
using
using ( new Impersonator( "myUsername", "myDomainname", "myPassword" ) ) { ... <code that executes under the new context> ... }
为我的项目工作得很好.
归档时间:
14 年,7 月 前
查看次数:
1350 次
最近记录: