解决asp.net创建的线程的用户改变引发的”拒绝访问”错误
asp.net创建的线程的用户由<identity impersonate=”true”/> 改为nt authority\network 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