在 C# 中,我想将 .tga 图片读入字符串变量。我使用许多变体从文本文件中读取,但每个解决方案都存在问题。文件大小 17Kb 为什么不阅读全文?
例如,这不起作用:
string item = "";
while ((item = sr.ReadLine()) != null)
{
picture_string += sr.ReadLine()+"";
}
这没用:
picture_string = sr.ReadToEnd();
这没用
picture_string = File.ReadAllText(path);