调用方法:
string baseName = System.IO.Directory.GetCurrentDirectory();
// baseName+"/"
// string fileName = @"C:\Users\59930\Desktop\20170605\WindowsFormsApp1\WindowsFormsApp1\WindowsFormsApp1\bin\x86\Debug\WindowsFormsApp1.exe";
string fileName = baseName + @"\CardRead.exe";
string para = "1.exe " + code;
Process p = new Process();
// baseName+"/"
// string fileName = @"C:\Users\59930\Desktop\20170605\WindowsFormsApp1\WindowsFormsApp1\WindowsFormsApp1\bin\x86\Debug\WindowsFormsApp1.exe";
string fileName = baseName + @"\CardRead.exe";
string para = "1.exe " + code;
Process p = new Process();
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.FileName = fileName;
p.StartInfo.CreateNoWindow = true;
p.StartInfo.Arguments = para;//参数以空格分隔,如果某个参数为空,可以传入””
p.Start();
p.WaitForExit();
string output = p.StandardOutput.ReadToEnd();
调用的exe 返回值中写
Console.Write(mmma);