问题
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