1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
|
Private Sub fermeture()
Dim testreussi As Boolean = ChercheLignes(FILE_RESULT & dossiertable & ".mtr", " <Status>Passed</Status>", 14) ' présence de 14 lignes "Passed" => picture visible
resultattest(testreussi)
End Sub
Function ChercheLignes(ByVal Fichier As String, ByVal LigneCherchee As String, ByVal NbOccurence As Integer) As Boolean
Return ((From ligne In System.IO.File.ReadAllLines(Fichier) Where ligne = LigneCherchee Select 1).Count = NbOccurence)
End Function
Public Sub resultattest(ByVal resultat As Boolean)
If Me.InvokeRequired Then
Me.Invoke(New Action(Of Boolean)(AddressOf resultattest), resultat)
Exit Sub
End If
'MsgBox(num)
Me.ToolStripProgressBar2.Value = 100
Me.ToolStripStatusLabel3.Text = "Terminé."
If resultat = True Then
Me.PictureBox24.Visible = True
Me.PictureBox23.Visible = False
Else
Me.PictureBox23.Visible = True
Me.PictureBox24.Visible = False
End If
End Sub |