可不可以不用找开对话框的方法?谢谢
追答你的意思是写死的那种吗?
在form上面引用系统类IO
Imports System.IO
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Dim sr As IO.StreamReader
TextBox1.Text = ""
Dim strFileName As String = "d:\testfile.txt"
sr = New IO.StreamReader(strFileName)
Do While sr.Peek() >= 0
TextBox1.Text &= sr.ReadLine & Chr(13) + Chr(10)
Loop
sr.Close()
End Sub
上面代码的意思就是找到d:\testfile.txt文件,并把里面的类容写道textbox1.text里面