Imports System.IO
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim r As New StreamReader("C:\jq.TXT") '打开文件
Dim Mytxt As String = ""
Dim s As String
Do While r.Peek > -1 '是否到文件尾
s = r.ReadLine '从打开的文件中读取一行内容
Mytxt = Mytxt & s & vbCrLf '逐行读取文本,并连接到变量Mytxt中
Loop
r.Close() '关闭对象
'判断是否与变量相等etjq,略了吧???
End Sub
End Class
有问题找百度