I have this segment of code:
Dim myStream As Stream = Nothing
Dim openFileDialog1 As New OpenFileDialog()
openFileDialog1.InitialDirectory = "C:\Users\Desktop\Sample Pictures"
openFileDialog1.Filter = "Pictures|*.jpg|Text|*.txt"
If openFileDialog1.ShowDialog() = System.Windows.Forms.DialogResult.OK Then
myStream = openFileDialog1.OpenFile()
If (myStream IsNot Nothing) Then
' Insert code to read the stream here.
End If
End Sub
End Class
I need to copy the file in myStream to some destination Folder.
Any idea how I can implement it?
Supposing the
myDestinationDiris the path where you want to copy your file thenThis will copy the selected file to the destination folder overwriting an existing file with the same name.