Code cutting off string after runs many times
This code runs in a loop. After the 38th time it runs, the string that gets printed to the text file cuts off immediately after the second "M", doesn't even print the comma, and then stops printing everything and ends.
What could be the cause of this?
private static void LogPayment(CDefeasancePayment paymentToLog, System.IO.StreamWriter outfile)
{
string li开发者_Go百科ne = "AddDefeasancePayment(DateTime.Parse(\"" + paymentToLog.PaymentDate.ToShortDateString() +
"\"), " + paymentToLog.Interest +
"M, " + paymentToLog.Principal + "M, DateTime.Parse(\"" +
paymentToLog.StripDate.ToShortDateString() + "\"), " + paymentToLog.StripPrice +
"M);\n";
outfile.Write(line);
}
Make sure you have flushed your outfile
buffer.
精彩评论