仅在运行代码的特定部分时模拟特定用户

本文引用下面的 Microsoft .NET Framework 类库命名空间:
 

System.Web.Security
System.Security.Principal
System.Runtime.InteropServices
模拟本地用户运行特定程序

以前用  Web.config 文件的 <identity> 标记,还是改成这种比较安全。
原文地址:http://support.microsoft.com/default.aspx?scid=kb;zh-cn;306158#4

原文地址:https://www.cnblogs.com/LCX/p/380175.html