Hello everybody,
With this instruction :
a log is written.
This application works quite well for several months, it is on its third machine now. A few lines written per week.
On one line, a certain number of null characters have been added at the beginning. So, the first field (to the ';') could not be parsed to a date.
I did not imagine that at the beginning, so I did not manage the exceptions.
In case it happens again, in the try...catch I replace \0 by \x3, to display the problematic line, with little squares in place of the null characters.
And then I suppress them in a notepad.
Any idea what happened and whether I should do anything else?
Oh, one precision: this did not happen on the last line, the file has been read successfully several times since the line was created.
So, maybe the null characters have been added later.
Hum, the machine is two weeks old, I hope it is not already weak ...
In case it helps, Microsoft's PowerToys are installed. Their spelling corrector is sometimes surprising.
That being said, the file is rarely accessed outside the C# application.
With this instruction :
StreamWriter writing instruction:
sw.WriteLine($"{DateTime.Now} ; {iNbTickets,2}");
a log is written.
This application works quite well for several months, it is on its third machine now. A few lines written per week.
On one line, a certain number of null characters have been added at the beginning. So, the first field (to the ';') could not be parsed to a date.
I did not imagine that at the beginning, so I did not manage the exceptions.
In case it happens again, in the try...catch I replace \0 by \x3, to display the problematic line, with little squares in place of the null characters.
And then I suppress them in a notepad.
Any idea what happened and whether I should do anything else?
Oh, one precision: this did not happen on the last line, the file has been read successfully several times since the line was created.
So, maybe the null characters have been added later.
Hum, the machine is two weeks old, I hope it is not already weak ...
In case it helps, Microsoft's PowerToys are installed. Their spelling corrector is sometimes surprising.
That being said, the file is rarely accessed outside the C# application.
Last edited: