Sharepoint identity conversion issues

In Sharepoint sometimes you need another user's identity (while the user is higher) to access the Sharepoint List by. The usual practice is achieved through WindowsImpersonationContext, SecuUtil32.LogonUser other ways. Specific implementation code number can be found online. After a lot of time to explore, in addition to these codes, to additionally be configured as follows:
1) Change the file Web.Config trust level, is particularly
<Trust Level = "Full" originUrl = "" />
2) Further, in IIS removed anonymous access.
In this way, you will be able to successfully run the code.
In addition, I created another site (independent of Sharepoint) to run the test program.

Reproduced in: https: //www.cnblogs.com/userinterface/archive/2005/12/15/297960.html

Guess you like

Origin blog.csdn.net/weixin_34315665/article/details/93389168