我正在用 c# 制作应用程序。在该应用程序中,我使用代码作为
private void WriteCurrentData(HttpRequest request, TextWriter writer)
{
Stream = Convert.ToString(objstream.m_StreamData[1]);
writer.WriteLine(string.Format(Stream));
writer.Flush();
}
其中 m_StreamData 是 ArrayList。 但有时我会收到错误
System.FormatException: Input string was not in correct format at System.Text.StringBuilder.AppendFormat() at System.String.Format()
请帮助我。提前致谢。
最佳答案
WriteLine() 中的 String.Format() 尝试(再次)解释该字符串。您已经将其转换为字符串,因此:
//writer.WriteLine(string.Format(Stream));
writer.WriteLine(Stream);
关于c# - 如何解决错误 "Input string is not in correct format",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9529498/