viernes, 2 de septiembre de 2022
POINT OF SERVICE DATALOGIC MAGELLAN 8400
Rename File NameOriginal(n)
while (File.Exists(newFullPath))
{
string tempFileName = string.Format("{0}({1})", fileNameOnly, count++);
newFullPath = Path.Combine(destination, $"{tempFileName}{extension}");
}
How To Debug easily a Service Windows
namespace WindowsService1
{
static class Program
{
static void Main()
{
if (Environment.UserInteractive)
{
Procces.Start(facturas);
}
else
{
ServiceBase[] ServicesToRun;
ServicesToRun = new ServiceBase[]
{
new Service1()
};
ServiceBase.Run(ServicesToRun);
}
}
}
}
Agrupar por linq v 1.0
public static List<string> AgruparCadenas(List<string> CadenasPendientesSinAgrupar)
{
List<string> CadenasPendientesAgrupadas = new List<string>();
var lineas_filtradas_por_import_key_y_agrupadas_agrupadas = CadenasPendientesSinAgrupar
.GroupBy(s => s)
.Select(g => new { Symbol = g.Key, Count = g.Count() });
foreach (var item in lineas_filtradas_por_import_key_y_agrupadas_agrupadas)
{
CadenasPendientesAgrupadas.Add(item.Symbol);
var count = item.Count;
}
return CadenasPendientesAgrupadas;
}