問題:
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#?