开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜