0
I have this code that generates a log always when the service ends, but it can happen to have unprocessed NF and I need to list it to be easy to identify.
Example 100 NF were not processed. In this case you are listing everything in the same line instead of breaking.
public void GerarLogoProcessamentoFim()
{
StreamWriter objWR = new StreamWriter(processo, true);
StringBuilder linha = new StringBuilder();
linha.Append(" --> NF PROCESSADAS: " + processadas);
linha.Append(" --> NF NÃO PROCESSADAS: " + nprocessadas);
if (nprocessadasNumero.Count > 0)
{
for (int i = 0; i < nprocessadasNumero.Count; i++)
{
linha.Append("NF - " + nprocessadasNumero[i]);
}
}
linha.Append(" <-- FINALIZAÇÃO:" + DateTime.Now.ToString("dd-MM-yyyy HH:mm:ss"));
objWR.WriteLine(linha.ToString());
objWR.Close();
}
only use character for new line:
\n
example:linha.Append("NF - " + nprocessadasNumero[i] + "\n");
– Rovann Linhalis