在vb.net使用System.IO读取文本文件
2009-09-17 10:05
387 查看
Imports System
Imports System.IO
Imports System.Collections
Module Module1
Sub Main()
Dim objReader As New StreamReader("c:\test.txt")
Dim sLine As String = ""
Dim arrText As New ArrayList()
Do
sLine = objReader.ReadLine()
If Not sLine Is Nothing Then
arrText.Add(sLine)
End If
Loop Until sLine Is Nothing
objReader.Close()
For Each sLine In arrText
Console.WriteLine(sLine)
Next
Console.ReadLine()
End Sub
End Module
Imports System.IO
Imports System.Collections
Module Module1
Sub Main()
Dim objReader As New StreamReader("c:\test.txt")
Dim sLine As String = ""
Dim arrText As New ArrayList()
Do
sLine = objReader.ReadLine()
If Not sLine Is Nothing Then
arrText.Add(sLine)
End If
Loop Until sLine Is Nothing
objReader.Close()
For Each sLine In arrText
Console.WriteLine(sLine)
Next
Console.ReadLine()
End Sub
End Module
相关文章推荐
- [转]使用 System.IO 和 Visual C# .NET 读取文本文件
- HOW TO:使用 System.IO 和 Visual C# .NET 读取文本文件
- 如何使用 System.IO 和 Visual C# 读取文本文件
- 如何使用 System.IO 和 Visual C# 读取文本文件
- 如何使用 System.IO 和 Visual C# 读取文本文件
- 使用 System.IO 的 stringreader 和 Visual C# 读取中文文本文件
- 简单使用下System.IO中的StreamReader读取文本文件
- 使用 System.IO 和 Visual C# 读取文本文件
- 通过程序 VB.Net 或 C# 读取文本文件行数
- VBA使用FileSystemObject将读取或写入文本文件(三)
- vb.net 使用Access数据库 保存和读取图片文件
- C#、VB.NET 使用System.Media.SoundPlayer播放音乐
- Visual Studio 2010 VB.NET 中使用System.Web.HttpUtility.UrlEncode提示HttpUtility不是Web成员的解决方法!
- 用vb.net读取INI配置文件的方法,使用API
- C#、VB.NET 使用System.Media.SoundPlayer播放音乐
- .net System.IO之Stream的使用详解
- VBA使用FileSystemObject将读取或写入文本文件(一)
- asp.net上传文件使用file控件,判断文件大小,取得文件路径时报错【System.IO.FileNotFoundException:未能找到文件】的解决办法
- VB.NET使用TagLib#读取MP3中的ID3v2标签
- C#、VB.NET 使用System.Media.SoundPlayer播放音乐