In a VB.NET Windows form application, how do I click on a button or image for a person and open the file Add browser to browse a file and assign it a path to a variable so that I can copy that file to another specific path?
You should use the OpenFileDialog class like this
dim fd As the OpenFileDialog = New OpenFileDialog () dim strFileName string as fd.Title = "Open File Dialog" fd.InitialDirectory = "C: \" Fd.Filter = "All Files (*. *) * *. * | All Files (*. *) * *. * "Fd.filterIndex = 2 fd.RestoreDirectory = true if fd.ShowDialog () = Dialog result. Ok then you can use the file class then strawfile name = fd.FileName end if .
Comments
Post a Comment