Alors:
C'est sous VB 6 donc:
Il y a des contrôles Dir, Drive et File, pour pouvoir chercher un fichier sur un disque, une zone de texte txtPath pour mémoriser le fichier choisit, et une zone de texte txtCtnt pour afficher le contenu du fichier.
Private Sub Dir1_Change()
File1.Path = Dir1.Path
End Sub
Private Sub Drive1_Change()
Dir1.Path = Drive1.Drive
End Sub
Private Sub File1_Click()
If Mid(File1.Path, Len(File1.Path), 1) <> "\" Then
txtPath.Text = File1.Path & "\" & File1.FileName
Else
txtPath.Text = File1.Path & File1.FileName
End If
End Sub
Private Sub Form_Load()
Dir1.Path = "C:\"
End Sub
Private Sub Label1_Click()
Dim tmp As String
Open txtPath.Text For Input As #1
Input #1, tmp
Close #1
txtCtnt.Text = tmp
End Sub
C'est le passage en gras sur lequel l'attention se porte^^
Quand on met ça, on obtient ce qui est contenu dans le fichier.. Mais si c'est un fichier en binaire, ça nous l'affiche en binaire (forcément^^).
Si j'essaie "Open txtPath for Binary Access Write as #1" par exemple, eh bien il enregistre la même valeur... Donc quand on fait un Get, on obtient toujours cette même valeur!
§H@®?|££€®