我可以从中等信任的ASP.NET应用程序中运行新过程吗?
-
28-09-2019 - |
题
我正在建立一个我想使用的ASP.NET MVC网站 OpenStv 进行民意调查。要通过OpenSTV运行结果,我必须运行可执行文件。 是从中等信任允许的 ASP.NET应用程序?
解决方案
你不能实例化 System.Diagnostics.Process
对象,除非您在跑步 FullTrust
.
如果您检查装饰班级的属性,您会发现对 FullTrust
:
[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
不隶属于 StackOverflow