Bonjour,
J'ai actuellement un private qui permet de rechercher dans un fichier texte des mots définie et les retourne sur une console, jusqu'à là, rien de bien méchant :
Private Sub Syncro()
Dim Findstring = IO.File.ReadAllText(My.Computer.FileSystem.CurrentDirectory & "\Path.txt")
Dim Lookfor(4) As String
Lookfor(0) = "SciTE"
Lookfor(1) = "Battle.net"
Lookfor(2) = "CCleaner"
Lookfor(3) = "FileZilla"
Lookfor(4) = "Gyazo"
Win32.AllocConsole()
Dim sr As StreamReader = New StreamReader(My.Computer.FileSystem.CurrentDirectory & "\Path.txt")
For Each line As String In File.ReadLines(My.Computer.FileSystem.CurrentDirectory & "\Path.txt")
For Each s In Lookfor
If line.Contains(s) Then
Console.WriteLine(line)
End If
Next
Next
End Sub
Maintenant le truc, c'est que j'aimerai utilisé lookfor dans un autre sub comme ceci :
Case "Lancer CCleaner"
Shell(lookfor(2))
Je pourrais tout simplement c/c mon tableau dans le sub, mais c'est pas du tout optimisé.
Merci de vos réponses, bonne journée.