这是我的代码,理论上应该运行编译的 .cpp 文件
var pc = new Process
{
StartInfo =
{
Verb = "runas",
Arguments = $"./Uploads/{fileName}",
FileName = "/bin/sh",
UseShellExecute = false,
RedirectStandardOutput = true,
RedirectStandardError = true,
RedirectStandardInput = true
};
pc.Start();
currentSetStatistic.ErrorWhileRunning = pc.StandardError.ReadToEnd();
pc.WaitForExit();
但我得到这个错误:“errorWhileRunning”:“./Uploads/Testing:1:语法错误:”)“意外\n”,
我的cpp文件
#include <iostream>
using namespace std;
int main()
{
cout<<"Hello World";
return 0;
}