2010-10-07 51 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 
相關問題