2010-10-07 48 views

回答

2

除非您在FullTrust上运行,否则无法实例化System.Diagnostics.Process对象。

如果检查装饰类的属性,你会看到FullTrust需求:

Process Class (MSDN)

[PermissionSetAttribute(SecurityAction.InheritanceDemand, Name = "FullTrust")] 
[HostProtectionAttribute(SecurityAction.LinkDemand, 
     SharedState = true, Synchronization = true, 
    ExternalProcessMgmt = true, SelfAffectingProcessMgmt = true)] 
[PermissionSetAttribute(SecurityAction.LinkDemand, Name = "FullTrust")] 
public class Process : Component 
相关问题