'If openFileDialog1.ShowDialog() = DialogResult.OK Then ' myStream = openFileDialog1.OpenFile() ' If Not (myStream Is Nothing) Then ' ' Insert code to read the stream here. ' myStream.Close() ' End If 'End If
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
' 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
Synes godt om
Ny brugerNybegynder
Din løsning...
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.