从 ASP.NET MVC 调用应用程序

发布于 2024-08-12 01:25:07 字数 207 浏览 1 评论 0原文

我试图看看是否可以从 ASP.NET MVC 应用程序调用外部(控制台)应用程序。它们都将在内部服务器上构建和部署,并且都将使用自定义形式的安全性,在执行任何操作之前通过 AD 验证用户,因此我并不太担心安全风险。 基本上,我试图为应用程序构建一个基于网络的前端,以便它可以在“任何地方”启动。基于 Web 的前端基本上会收集所有参数并在运行时将它们传递给应用程序。

有什么想法吗?

Im trying to see if it is at all possible to call an external (console) application from an ASP.NET MVC app. They will both be build and deployed on internal servers, and both will use a custom form of security, validating the user VIA AD before anything executes, so Im not overly worried about the security risks.
Basically, Im trying to build a web based front end for an application so it can be kicked off "anywhere". The web based front end will basically collect all the parameters and pass them to the application at run time.

Any thoughts?

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

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

发布评论

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

评论(2

你的呼吸 2024-08-19 01:25:07

创建一个 Process 对象,并在 ProcessStartInfo 中提供所有信息,然后启动进程。

就像这样:

        Process notepad = new Process();

        notepad.StartInfo.FileName = "notepad.exe";
        notepad.StartInfo.Arguments = "stackoverflow.txt";

        notepad.Start();

当你给你的工作进程足够的权限来启动该进程时,这就会起作用。实际上,我们在我们的一个应用程序中使用了相同的东西。

Create a Process object, and give all the information in the ProcessStartInfo, then just start the process.

Something like:

        Process notepad = new Process();

        notepad.StartInfo.FileName = "notepad.exe";
        notepad.StartInfo.Arguments = "stackoverflow.txt";

        notepad.Start();

That's gotta work when you give your worker process enough rights to start the process. We actually use something the same in one of our applications.

宣告ˉ结束 2024-08-19 01:25:07

如果您无法让您的 Web 应用程序运行进程(我不知道,可能是因为 ASP.NET 服务权限不足等),您可以让另一个进程在后台运行,等待运行控制台应用程序的请求。然后,您的 ASP.NET MVC 应用程序将使用管道或其他 IPC 内容与其进行通信。

If you can't have your web app to run processes - I don't know, maybe because ASP.NET service has insuccifient rights, etc - you can have another process run in background, waiting for requests to run console apps. Your ASP.NET MVC app will then communicate with it using pipes or another IPC stuff.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文