39e3a9f7fa
- Impostato esempio call consol 2 console - pronto x creare il vero excel importer (+ altre utils)
42 lines
1.0 KiB
C#
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(); |