解决ASP.NET创建的线程的用户改变引发的拒绝访问错误
程序员文章站
2022-08-24 08:48:28
asp.net创建的线程的用户由 改为nt authoritynetwork service,...
asp.net创建的线程的用户由<identity impersonate="true"/> 改为nt authoritynetwork service, 引起"system.unauthorizedaccessexception","拒绝访问"
dim thr as threading.thread
dim l as system.security.principal.windowsidentity
function print()
thr = new threading.thread(addressof printautocad)
thr.start()
l = system.security.principal.windowsidentity.getcurrent
end function
private sub printautocad()
system.security.principal.windowsidentity.impersonate(l.token)
...
end function
上一篇: 两性生活的好处是什么
下一篇: 10天学会ASP.net之第九天