Executing an .exe in a DNN Module

倖福魔咒の 提交于 2019-12-24 02:05:32

问题


I'm trying to get my DNN module (6.1.3) to start up any kind of executable when a certain condition happens in my program. At this time I'm just trying to have it run Notepad and create a text file. Here's what I'm trying at the moment:

ProcessStartInfo pi = new ProcessStartInfo(@"C:\Windows\notepad.exe");
pi.Arguments = "> test.txt";
pi.Verb = "runas";
pi.CreateNoWindow = false;
pi.ErrorDialog = true;
pi.RedirectStandardError = true;
pi.RedirectStandardInput = true;
pi.RedirectStandardOutput = true;
pi.UseShellExecute = false;
using (Process compiler = new Process())
{
    compiler.StartInfo = pi;
    compiler.Start();
}

I've tried other methods, but nothing has worked so far. I have a suspicion that it might be a permission issue, like I need to pass in admin rights or something. I'm also unsure where it's going to attempt to create the .txt. I would think it'd be where the module is located, but again, I'm unsure. At this time I'm only running this on localhost.

来源:https://stackoverflow.com/questions/23070339/executing-an-exe-in-a-dnn-module

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!