标题: 关于vb.net的问题 [打印本页] 作者: kopi冰 时间: 2012-10-13 09:13 PM 标题: 关于vb.net的问题 Private Sub OpenToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles OpenToolStripMenuItem.Click
Dim AllText As String = "", LineofText As String = ""
OpenFileDialog1.Filter = "text files(*.txt)|*.txt"
OpenFileDialog1.ShowDialog() 'display open dialog box
If OpenFileDialog1.FileName <> "" Then
Try 'open file and trap any errors using handler
FileOpen(1, OpenFileDialog1.FileName, OpenMode.Input)
Do Until EOF(1)
LineofText = LineInput(1)
AllText = AllText & LineofText & vbCrLf