因此 TextReader.ReadLine() 返回一个字符串,但 TextReader.Read() 返回一个 int 值。这个 int 值似乎也是某种我无法识别的格式。是否可以将这个整数转换为字符?谢谢你的帮助。
编辑:
TextReader 值 = new StreamReader(@"txt");
string SValue1;
int Value1;
Value1 = Values.Read();
Console.WriteLine(Value1);
Console.ReadKey();
Run Code Online (Sandbox Code Playgroud)
当它读出值时,它给出 51 作为输出。txt文件中的第一个字符是3。为什么会这样做呢?