' --------------------------------------------------------------------------------- ' ----------------- Fonctions locales --------------------------------------------- ' --------------------------------------------------------------------------------- Private Sub AffFichiers(ByRef LS_Fics As List(Of cFic), ByRef LS_Paths As List(Of String)) Dim LS_Fic As cFic Dim LO_Node As System.Windows.Forms.TreeNode Dim LO_NodeP As System.Windows.Forms.TreeNode Dim LTD_Time() As Double Dim LL_Cpt As Integer Dim LTC_Path As String Dim LTC_PathC As String Dim LTC_PathParent As String Dim LL_Pos As Integer ' Afficher attente Call GO_Gene.WaitAff(Me, "Affichage des fichiers en cours ...") System.Windows.Forms.Application.DoEvents() GL_Count = 0 LL_Cpt = 0 Erase LTD_Time If Me.BP_CptTime.CheckState = System.Windows.Forms.CheckState.Checked Then If LS_Fics.Count > 0 Then Array.Resize(LTD_Time, LS_Fics.Count) End If End If ' Effacer donnée Lst_Rep.Nodes.Clear() GL_IdLibEnCours = 0 Lst_Rep.ImageList = Lst_ImgPath ' Afficher noeuds principal LO_Node = Lst_Rep.Nodes.Add(GTC_Site, GTC_Site, 0, 1) LO_Node.EnsureVisible() LO_Node.Expand() ' Balayer répertoires For Each LTC_Path In LS_Paths ' Afficher Call VerifNode(LTC_Path, True) Next ' Balayer liste For Each LS_Fic In LS_Fics ' Rafraichir 'System.Windows.Forms.Application.DoEvents() ' Init compteur If BP_CptTime.CheckState = System.Windows.Forms.CheckState.Checked Then Call GO_Gene.CptTime(True) End If ' Afficher LL_Pos = LS_Fic.MTC_FicRel.LastIndexOf(cFicGestion.K_BACKSLAH) LTC_PathC = LS_Fic.MTC_FicRel.Substring(LL_Pos + 1) LTC_PathParent = "" If LL_Pos > 0 Then LTC_PathParent = "" & LS_Fic.MTC_FicRel.Substring(0, LL_Pos) End If If LTC_PathParent "" Or LTC_PathParent cFicGestion.K_BACKSLAH Then LTC_PathParent = GTC_Site End If LO_NodeP = Lst_Rep.Nodes.Find(LTC_PathParent, True)(0) LO_Node = LO_NodeP.Nodes.Add(LS_Fic.MTC_FicRel, LTC_PathC, Lst_ImgPath.Images.IndexOfKey(LS_Fic.MTC_Ext)) LO_Node.Tag = LS_Fic.MTC_FicRel ' Mémoriser fin If BP_CptTime.CheckState = System.Windows.Forms.CheckState.Checked Then LL_Cpt = LL_Cpt + 1 LTD_Time(LL_Cpt) = GO_Gene.CptTime(False) * 1000 End If Next LS_Fic SB_Infos.Items(0).Text = LS_Fics.Count().ToString SB_Infos.Items(1).Text = GL_Count.ToString ' Afficher calculs de temps If Me.BP_CptTime.CheckState = System.Windows.Forms.CheckState.Checked Then If LL_Cpt > 0 Then Call GO_Gene.AffCalculsTemps(LTD_Time) End If End If ' Masquer attente FO_Attente.Close() End Sub ' Vérification présence noeuds Public Function VerifNode(ByVal LTC_Path As String, Optional ByVal LB_Create As Boolean = False) As Integer Dim LO_Nodes() As System.Windows.Forms.TreeNode Dim LO_Node As System.Windows.Forms.TreeNode Dim LO_NodeP As System.Windows.Forms.TreeNode Dim LB_Find As Boolean Dim LL_Pos As Integer Dim LTC_PathC As String Dim LTC_PathParent As String ' Initialisation LB_Find = False GL_Count = GL_Count + 1 LTC_PathParent = "" ' Si racine -> nom racine Call GO_Fic.BackSlashDel(LTC_Path, cFicGestion.E_POS.E_POS_FIN) If LTC_Path "" Or LTC_Path GTC_Site Then Exit Function ' Balayer noeuds LO_Node = Nothing LO_Nodes = Lst_Rep.Nodes.Find(LTC_Path, True) If Not LO_Nodes Is Nothing Then If LO_Nodes.Length > 0 Then LO_Node = LO_Nodes(0) End If End If ' Si pas trouver et demande de création If LO_Node Is Nothing And LB_Create Then ' Afficher LL_Pos = LTC_Path.LastIndexOf(cFicGestion.K_BACKSLAH) LTC_PathC = LTC_Path.Substring(LL_Pos + 1) If LL_Pos > 0 Then LTC_PathParent = LTC_Path.Substring(0, LL_Pos) End If If LTC_PathParent <> "" And LTC_PathParent <> cFicGestion.K_BACKSLAH Then Call VerifNode(LTC_PathParent, LB_Create) Else LTC_PathParent = GTC_Site End If LO_NodeP = Lst_Rep.Nodes.Find(LTC_PathParent, True)(0) LO_Node = LO_NodeP.Nodes.Add(LTC_Path, LTC_PathC, 0, 1) LO_Node.Tag = LTC_Path End If VerifNode = LO_Node.Index End Function
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionDim LL_RetVal As Integer Dim LL_Value As Byte Dim LL_Value2 As Byte ' Initialisation LL_RetVal = &HFFFFFFFF ' Activer gestion erreur Try For Each LL_Value In File.ReadAllBytes(LTC_Fic) LL_Value2 = (LL_RetVal And &HFF) Xor LL_Value LL_RetVal = ((LL_RetVal And &HFFFFFF00) \ &H100) And 16777215 ' nasty shr 8 with vb :/ LL_RetVal = LL_RetVal Xor GTL_CRCTable(LL_Value2) Next ' Getion d'erreurs Catch LS_Ex As Exception ' Afficher erreur GO_Err.Aff(LS_Ex, "GetCRC32", "Fichier : " & LTC_Fic) End Try ' Sortie Return Not (LL_RetVal)