Public Class FrmStructureFilePath
    Inherits System.Windows.Forms.Form

#Region " Code généré par le Concepteur Windows Form "

    Public Sub New()
        MyBase.New()

        'Cet appel est requis par le Concepteur Windows Form.
        InitializeComponent()

        'Ajoutez une initialisation quelconque après l'appel InitializeComponent()

    End Sub

    'La méthode substituée Dispose du formulaire pour nettoyer la liste des composants.
    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
        If disposing Then
            If Not (components Is Nothing) Then
                components.Dispose()
            End If
        End If
        MyBase.Dispose(disposing)
    End Sub

    'Requis par le Concepteur Windows Form
    Private components As System.ComponentModel.IContainer

    'REMARQUE : la procédure suivante est requise par le Concepteur Windows Form
    'Elle peut être modifiée en utilisant le Concepteur Windows Form.  
    'Ne la modifiez pas en utilisant l'éditeur de code.
    Friend WithEvents TxtPath As System.Windows.Forms.TextBox
    Friend WithEvents LstDir As System.Windows.Forms.ListBox
    Friend WithEvents LstFile As System.Windows.Forms.ListBox
    Friend WithEvents TxtFile As System.Windows.Forms.TextBox
    Friend WithEvents ChkArchive As System.Windows.Forms.CheckBox
    Friend WithEvents ChkCompressed As System.Windows.Forms.CheckBox
    Friend WithEvents ChkDir As System.Windows.Forms.CheckBox
    Friend WithEvents ChkHidden As System.Windows.Forms.CheckBox
    Friend WithEvents ChkNormal As System.Windows.Forms.CheckBox
    Friend WithEvents ChkRO As System.Windows.Forms.CheckBox
    Friend WithEvents ChkSys As System.Windows.Forms.CheckBox
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        Me.TxtPath = New System.Windows.Forms.TextBox
        Me.LstDir = New System.Windows.Forms.ListBox
        Me.LstFile = New System.Windows.Forms.ListBox
        Me.TxtFile = New System.Windows.Forms.TextBox
        Me.ChkArchive = New System.Windows.Forms.CheckBox
        Me.ChkCompressed = New System.Windows.Forms.CheckBox
        Me.ChkDir = New System.Windows.Forms.CheckBox
        Me.ChkHidden = New System.Windows.Forms.CheckBox
        Me.ChkNormal = New System.Windows.Forms.CheckBox
        Me.ChkRO = New System.Windows.Forms.CheckBox
        Me.ChkSys = New System.Windows.Forms.CheckBox
        Me.SuspendLayout()
        '
        'TxtPath
        '
        Me.TxtPath.Location = New System.Drawing.Point(1, 0)
        Me.TxtPath.Name = "TxtPath"
        Me.TxtPath.Size = New System.Drawing.Size(399, 20)
        Me.TxtPath.TabIndex = 0
        Me.TxtPath.Text = "TextBox1"
        '
        'LstDir
        '
        Me.LstDir.Location = New System.Drawing.Point(0, 21)
        Me.LstDir.Name = "LstDir"
        Me.LstDir.Size = New System.Drawing.Size(196, 199)
        Me.LstDir.TabIndex = 1
        '
        'LstFile
        '
        Me.LstFile.Location = New System.Drawing.Point(198, 22)
        Me.LstFile.Name = "LstFile"
        Me.LstFile.Size = New System.Drawing.Size(196, 199)
        Me.LstFile.TabIndex = 2
        '
        'TxtFile
        '
        Me.TxtFile.Location = New System.Drawing.Point(1, 225)
        Me.TxtFile.Name = "TxtFile"
        Me.TxtFile.Size = New System.Drawing.Size(395, 20)
        Me.TxtFile.TabIndex = 3
        Me.TxtFile.Text = "TextBox1"
        '
        'ChkArchive
        '
        Me.ChkArchive.Location = New System.Drawing.Point(400, 0)
        Me.ChkArchive.Name = "ChkArchive"
        Me.ChkArchive.Size = New System.Drawing.Size(88, 16)
        Me.ChkArchive.TabIndex = 4
        Me.ChkArchive.Text = "Archive"
        '
        'ChkCompressed
        '
        Me.ChkCompressed.Location = New System.Drawing.Point(400, 16)
        Me.ChkCompressed.Name = "ChkCompressed"
        Me.ChkCompressed.Size = New System.Drawing.Size(88, 16)
        Me.ChkCompressed.TabIndex = 5
        Me.ChkCompressed.Text = "Compressé"
        '
        'ChkDir
        '
        Me.ChkDir.Location = New System.Drawing.Point(400, 32)
        Me.ChkDir.Name = "ChkDir"
        Me.ChkDir.Size = New System.Drawing.Size(88, 16)
        Me.ChkDir.TabIndex = 6
        Me.ChkDir.Text = "Dossier"
        '
        'ChkHidden
        '
        Me.ChkHidden.Location = New System.Drawing.Point(400, 48)
        Me.ChkHidden.Name = "ChkHidden"
        Me.ChkHidden.Size = New System.Drawing.Size(88, 16)
        Me.ChkHidden.TabIndex = 7
        Me.ChkHidden.Text = "Caché"
        '
        'ChkNormal
        '
        Me.ChkNormal.Location = New System.Drawing.Point(400, 64)
        Me.ChkNormal.Name = "ChkNormal"
        Me.ChkNormal.Size = New System.Drawing.Size(88, 16)
        Me.ChkNormal.TabIndex = 8
        Me.ChkNormal.Text = "Normal"
        '
        'ChkRO
        '
        Me.ChkRO.Location = New System.Drawing.Point(400, 80)
        Me.ChkRO.Name = "ChkRO"
        Me.ChkRO.Size = New System.Drawing.Size(88, 16)
        Me.ChkRO.TabIndex = 9
        Me.ChkRO.Text = "Lecture seule"
        '
        'ChkSys
        '
        Me.ChkSys.Location = New System.Drawing.Point(400, 96)
        Me.ChkSys.Name = "ChkSys"
        Me.ChkSys.Size = New System.Drawing.Size(88, 16)
        Me.ChkSys.TabIndex = 10
        Me.ChkSys.Text = "Système"
        '
        'FrmStructureFilePath
        '
        Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
        Me.ClientSize = New System.Drawing.Size(490, 273)
        Me.Controls.Add(Me.ChkSys)
        Me.Controls.Add(Me.ChkRO)
        Me.Controls.Add(Me.ChkNormal)
        Me.Controls.Add(Me.ChkHidden)
        Me.Controls.Add(Me.ChkDir)
        Me.Controls.Add(Me.ChkCompressed)
        Me.Controls.Add(Me.ChkArchive)
        Me.Controls.Add(Me.TxtFile)
        Me.Controls.Add(Me.LstFile)
        Me.Controls.Add(Me.LstDir)
        Me.Controls.Add(Me.TxtPath)
        Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog
        Me.MaximizeBox = False
        Me.Name = "FrmStructureFilePath"
        Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
        Me.Text = "FrmStructureFilePath"
        Me.ResumeLayout(False)

    End Sub

#End Region

    Private Sub TxtPath_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TxtPath.TextChanged
        Dim Tst As NHenry.Scandir.TPath
        Dim i As Integer
        Dim Fics As System.IO.FileInfo()
        Dim Dirs As System.IO.DirectoryInfo()
        Tst.Path = TxtPath.Text
        LstDir.Items.Clear()
        LstFile.Items.Clear()
        If Tst.IsCorrect Then
            If Tst.IsExist Then
                TxtPath.BackColor = Color.Green
                Fics = Tst.GetFiles
                For i = 0 To UBound(Fics)
                    LstFile.Items.Add(Fics(i).FullName)
                Next
                Dirs = Tst.GetSubDirs
                For i = 0 To UBound(Dirs)
                    LstDir.Items.Add(Dirs(i).FullName)
                Next
                Me.ChkArchive.Checked = ((Tst.Attributes And IO.FileAttributes.Archive) <> 0)
                Me.ChkCompressed.Checked = ((Tst.Attributes And IO.FileAttributes.Compressed) <> 0)
                Me.ChkDir.Checked = ((Tst.Attributes And IO.FileAttributes.Directory) <> 0)
                Me.ChkHidden.Checked = ((Tst.Attributes And IO.FileAttributes.Hidden) <> 0)
                Me.ChkNormal.Checked = ((Tst.Attributes And IO.FileAttributes.Normal) <> 0)
                Me.ChkRO.Checked = ((Tst.Attributes And IO.FileAttributes.ReadOnly) <> 0)
                Me.ChkSys.Checked = ((Tst.Attributes And IO.FileAttributes.System) <> 0)
            Else
                TxtPath.BackColor = Color.Yellow
            End If
        Else
            TxtPath.BackColor = Color.Red
        End If
    End Sub

    Private Sub TxtFile_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TxtFile.TextChanged
        Dim mFile As NHenry.Scandir.TFile
        mFile.FileName = TxtFile.Text
        If mFile.IsCorrect Then
            If mFile.IsExist Then
                TxtFile.BackColor = Color.Green
                Me.ChkArchive.Checked = ((mFile.Attributes And IO.FileAttributes.Archive) <> 0)
                Me.ChkCompressed.Checked = ((mFile.Attributes And IO.FileAttributes.Compressed) <> 0)
                Me.ChkDir.Checked = ((mFile.Attributes And IO.FileAttributes.Directory) <> 0)
                Me.ChkHidden.Checked = ((mFile.Attributes And IO.FileAttributes.Hidden) <> 0)
                Me.ChkNormal.Checked = ((mFile.Attributes And IO.FileAttributes.Normal) <> 0)
                Me.ChkRO.Checked = ((mFile.Attributes And IO.FileAttributes.ReadOnly) <> 0)
                Me.ChkSys.Checked = ((mFile.Attributes And IO.FileAttributes.System) <> 0)
            Else
                TxtFile.BackColor = Color.Yellow
            End If
        Else
            TxtFile.BackColor = Color.Red
        End If
    End Sub
End Class
