从 ASP.NET MVC 调用应用程序
我试图看看是否可以从 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
创建一个 Process 对象,并在 ProcessStartInfo 中提供所有信息,然后启动进程。
就像这样:
当你给你的工作进程足够的权限来启动该进程时,这就会起作用。实际上,我们在我们的一个应用程序中使用了相同的东西。
Create a
Process
object, and give all the information in theProcessStartInfo
, then just start the process.Something like:
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.
如果您无法让您的 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.