Files
Mapo-IOB-WIN/EgwCApp/EgwCApp.Testing/Program.cs
T
Samuele E. Locatelli 39e3a9f7fa EgwApp - Console:
- Impostato esempio call consol 2 console
- pronto x creare il vero excel importer (+ altre utils)
2022-12-16 20:14:04 +01:00

42 lines
1.0 KiB
C#

// See https://aka.ms/new-console-template for more information
using System.Diagnostics;
string separator = "--------------------------------------";
Console.WriteLine(separator);
Console.WriteLine("Console Test Application");
Console.WriteLine(separator);
Console.WriteLine();
Console.WriteLine("calling ext app with args[]:");
string appPath = "./Utils/ExImp.exe";
string procArg = @"C:\Temp\test.log";
Console.WriteLine($"{appPath} {procArg}");
ProcessStartInfo psi = new ProcessStartInfo
{
FileName = appPath,
Arguments = $"{procArg}",
WindowStyle = ProcessWindowStyle.Minimized,
//WindowStyle = ProcessWindowStyle.Hidden,
UseShellExecute = false,
//CreateNoWindow = true,
RedirectStandardOutput = true,
RedirectStandardInput = true,
};
//childProc.StartInfo = psi;
Process p = Process.Start(psi);
string q = "";
while (!p.HasExited)
{
q += p.StandardOutput.ReadToEnd();
}
Console.WriteLine("Ext prog ended");
Console.WriteLine("Data received:");
Console.WriteLine();
Console.WriteLine(q);
Console.ReadLine();