【 解 説 】
テキストファイルを読み込むにはStreamReaderを使用します。
【 例 文 】
1 2 3 4 5 6 7 8 9 10 11 12 |
' You have to catch exceptions in caller Public Function Load(ByVal fileName As String) As String Dim text As String = "" Dim reader As StreamReader = New StreamReader(fileName, System.Text.Encoding.[Default]) text = reader.ReadToEnd() reader.Close() Return text End Function |
■お薦め参考関連資料
Microsoft、Visual Studio、Visual Basic、Visual C#、Windows Vista、Windows Server、SQL Server、Visual C++、Visual Web Developerは、米国 Microsoft Corporationの米国及びその他の国における登録商標または商標です。