问题:
What is the quickest way to read a text file into a string variable?将文本文件读入字符串变量的最快方法是什么?
I understand it can be done in several ways, such as read individual bytes and then convert those to string.我知道它可以通过多种方式完成,例如读取单个字节,然后将它们转换为字符串。 I was looking for a method with minimal coding.我正在寻找一种编码最少的方法。
解决方案:
参考一: https://stackoom.com/question/UziX参考二: How to read an entire file to a string using C#?