如何通过反射获取SecurityPermissionAttribute的构造函数值

时间:2020-02-03 05:56:45

标签: .net reflection attributes

我正在尝试获取SecurityPermissionAttribute的参数,但是在反射过程中什么也没有返回。似乎无法获取“ SecurityAction.Demand, ControlThread=true”值

我正在使用仅反射加载上下文:

MethodBase.GetCustomAttributesData()

针对: mscorlib,版本= 4.0.0.0,文化=中性,PublicKeyToken = b77a5c561934e089 C:\ Windows \ Microsoft.NET \ Framework64 \ v4.0.30319 \ mscorlib.dll

类:System.Threading.Thread System.Threading.Thread

[System.Security.SecuritySafeCritical] //自动生成 [已过时(“ Thread.Suspend已过时。请使用System.Threading中的其他类,例如Monitor,Mutex,Event和Semaphore,以同步线程或保护资源。http://go.microsoft.com/fwlink/?linkid=14202”,false)] [SecurityPermission (SecurityAction.Demand,ControlThread = true)] [SecurityPermission(SecurityAction.Demand,ControlThread = true)] 公共无效Suspend(){SuspendInternal(); }

0 个答案:

没有答案
相关问题