89 lines
2.2 KiB
C#
89 lines
2.2 KiB
C#
// See https://aka.ms/new-console-template for more information
|
|
|
|
using EgwCApp.Core;
|
|
using System.Diagnostics;
|
|
using Newtonsoft.Json;
|
|
using EgwCApp.Testing;
|
|
|
|
Dictionary<string, TimeSpan> statsColl = new Dictionary<string, TimeSpan>();
|
|
Stopwatch sw = new Stopwatch();
|
|
|
|
string separator = "--------------------------------------";
|
|
Console.WriteLine(separator);
|
|
Console.WriteLine("Console Test Application");
|
|
Console.WriteLine(separator);
|
|
Console.WriteLine();
|
|
|
|
// creo il file di configurazione...
|
|
string fileName = "conf.json";
|
|
ConfigFile newConf = new ConfigFile();
|
|
string rawData = "";
|
|
|
|
// test CSV
|
|
//newConf = new ConfigFile()
|
|
//{
|
|
// Type = ImportType.CSV,
|
|
// FileInPath = @"C:\Temp\test.log",
|
|
// Return = ReturnMode.Console
|
|
//};
|
|
|
|
|
|
// cerco file xlsx e ciclo...
|
|
var listaFiles = Directory.GetFiles(@"C:\temp\import\", "*.xlsx");
|
|
if (listaFiles != null && listaFiles.Count() > 0)
|
|
{
|
|
foreach (var item in listaFiles)
|
|
{
|
|
FileProcMan fpm = new FileProcMan("Tools", "ExcImport.exe");
|
|
TimeSpan timeElaps = fpm.doProcess(item);
|
|
|
|
statsColl.Add($"Ext prog executed for {item}", timeElaps);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//ProcessStartInfo psi = new ProcessStartInfo
|
|
//{
|
|
// FileName = appPath,
|
|
// Arguments = $"{procArg}",
|
|
// WindowStyle = ProcessWindowStyle.Minimized,
|
|
// //WindowStyle = ProcessWindowStyle.Hidden,
|
|
// UseShellExecute = false,
|
|
// //CreateNoWindow = true,
|
|
// RedirectStandardOutput = true,
|
|
// RedirectStandardInput = true,
|
|
//};
|
|
|
|
//sw.Start();
|
|
|
|
//Process p = Process.Start(psi);
|
|
|
|
//string q = "";
|
|
//while (!p.HasExited)
|
|
//{
|
|
// q += p.StandardOutput.ReadToEnd();
|
|
//}
|
|
|
|
//sw.Stop();
|
|
//var timeElaps = sw.Elapsed;
|
|
//statsColl.Add("Ext prog executed", timeElaps);
|
|
Console.WriteLine(separator);
|
|
Console.WriteLine("press enter to proceed...");
|
|
|
|
Console.ReadLine();
|
|
//sw.Restart();
|
|
//Console.WriteLine("Data received:");
|
|
//Console.WriteLine(q);
|
|
//Console.WriteLine();
|
|
//sw.Stop();
|
|
//timeElaps = sw.Elapsed;
|
|
//statsColl.Add("Data Received", timeElaps);
|
|
|
|
foreach (var item in statsColl)
|
|
{
|
|
Console.WriteLine($"{item.Key} {item.Value.TotalMilliseconds} ms");
|
|
}
|
|
//Console.WriteLine($"Display executed in {timeElaps.TotalMilliseconds} ms");
|
|
|
|
Console.ReadLine(); |