Private Sub readfile() Dim oldextension As String Dim letext() As String oldextension = OpenFileDialog1.FileName.Substring(OpenFileDialog1.FileName.Length - 3) OpenFileDialog1.FileName = OpenFileDialog1.FileName.Replace(oldextension, "txt") Try letext = System.IO.File.ReadAllLines(OpenFileDialog1.FileName) ListBox1.Items.AddRange(letext) Catch ex As Exception MessageBox.Show("fichier introuvable") End End Try End Su
Private Sub readfile() Dim newfilename As String Dim letext() As String newfilename = System.IO.Path.ChangeExtension(OpenFileDialog1.FileName, "txt") Try letext = System.IO.File.ReadAllLines(newfilename) ListBox1.Items.AddRange(letext) Catch ex As Exception MessageBox.Show("fichier introuvable") End End Try End Sub
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionEnd Suil manque le b
End Sub