hvordan viser jeg indholdet af en fil i en textbox
har følgende kode:Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
TextBox1.Text = OpenFile()
End Sub
Private Function OpenFile() As String
' Displays an OpenFileDialog and shows the read/only files.
Dim path As String
Dim DlgOpenFile As New OpenFileDialog
DlgOpenFile.ShowReadOnly = True
Dim Fs As FileStream
If DlgOpenFile.ShowDialog() = DialogResult.OK Then
'FileOpen(1, "TESTFILE", OpenMode.Input)
'' Close before reopening in another mode.
'FileClose(1)
' If ReadOnlyChecked is true, uses the OpenFile method to
' open the file with read/only access.
'If DlgOpenFile.ReadOnlyChecked = True Then
' Return DlgOpenFile.OpenFile()
' ' Otherwise, opens the file with read/write access.
'Else
path = DlgOpenFile.FileName
'Return New FileStream(Path, System.IO.FileMode.Open, _
' System.IO.FileAccess.ReadWrite)
'End If
End If
Return path
End Function
Private Sub OpenFileDialog1_FileOk(ByVal sender As System.Object, ByVal e As System.ComponentModel.CancelEventArgs)
End Sub
