我可以从中等信任的 ASP.NET 应用程序运行新进程吗?

发布于 2024-09-26 02:51:29 字数 177 浏览 0 评论 0原文

我正在构建一个 ASP.NET MVC 网站,我想在其中使用 OpenSTV 进行民意调查。要通过 OpenSTV 运行结果,我必须运行可执行文件。 中等信任 ASP.NET 应用程序是否允许这样做?

I'm building an ASP.NET MVC site where I want to use OpenSTV to conduct polls. To run results through OpenSTV, I'd have to run the executable. Is that allowed from a medium-trust ASP.NET application?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

笔芯 2024-10-03 02:51:29

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

如果您检查装饰类的属性,您将看到对 FullTrust 的需求:

进程类 (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

You can't instantiate a System.Diagnostics.Process object unless you're running at FullTrust.

If you examine the attributes decorating the class you'll see the demand for 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
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文