gpt4 book ai didi

c# - 代码在运行多次后切断字符串

转载 作者:太空狗 更新时间:2023-10-30 01:26:40 26 4
gpt4 key购买 nike

这段代码循环运行。第 38 次运行后,打印到文本文件的字符串在第二个“M”后立即截断,甚至不打印逗号,然后停止打印所有内容并结束。

这可能是什么原因造成的?

private static void LogPayment(CDefeasancePayment paymentToLog, System.IO.StreamWriter outfile)
{
string line = "AddDefeasancePayment(DateTime.Parse(\"" + paymentToLog.PaymentDate.ToShortDateString() +
"\"), " + paymentToLog.Interest +
"M, " + paymentToLog.Principal + "M, DateTime.Parse(\"" +
paymentToLog.StripDate.ToShortDateString() + "\"), " + paymentToLog.StripPrice +
"M);\n";
outfile.Write(line);
}

最佳答案

确保您已刷新outfile 缓冲区。

关于c# - 代码在运行多次后切断字符串,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4380846/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com