Probleme avec OpenFileDialog
bonjour à tous,
Voila j'ai un soucis j'ai fait un bouton avec un OpenFileDialog
mais lorsque je selectionne mon programme par le biais du OFD cela me plante le programme (il me dit qu'il manque des fichiers).
mon premier essais
Code:
1 2 3 4 5 6 7 8 9 10
| Dim filename As String = OpenFileDialog1.FileName
Dim P As New System.Diagnostics.Process()
OpenFileDialog1.InitialDirectory = "c:\"
OpenFileDialog1.Filter = "Installeur msi (*.msi)|*.msi|executable installeur (*.exe)|*.exe"
OpenFileDialog1.ShowDialog()
P.StartInfo.FileName = filename
P.Start()
P.Close() |
mon Second essais
Code:
1 2 3 4 5 6 7 8
|
Dim filename As String = OpenFileDialog1.FileName
Dim P As New System.Diagnostics.Process()
OpenFileDialog1.InitialDirectory = "c:\"
OpenFileDialog1.Filter = "Installeur msi (*.msi)|*.msi|executable installeur (*.exe)|*.exe"
OpenFileDialog1.ShowDialog()
Shell(filename, AppWinStyle.MaximizedFocus) |
et puis en cherchant je suis tombé sur un autre code mais cela me mais un message d'erreur
Code:
1 2 3 4 5 6 7 8
|
Dim filename As String = OpenFileDialog1.FileName
OpenFileDialog1.InitialDirectory = "C:\"
OpenFileDialog1.Filter = "Lanceur batch (*.bat)|*.bat|executable (*.exe)|*.exe"
OpenFileDialog1.ShowDialog()
System.Diagnostics.Process.Start(filename) |
et le message d'erreur me met :
Citation:
Aucune application n'est associée au fichier spécifié pour cette opération
voila j'espere que vous pourrez m'aider merci d'avance...