Récupérer le jour de la semaine et l'heure [Résolu]

Messages postés
301
Date d'inscription
mercredi 22 septembre 2010
Dernière intervention
27 février 2018
- 12 sept. 2013 à 22:20 - Dernière réponse :
Messages postés
301
Date d'inscription
mercredi 22 septembre 2010
Dernière intervention
27 février 2018
- 1 sept. 2014 à 00:28
Bonjour,
je voudrais développer une petite application qui coupe internet selon une plage horaire qui à été définie par l'utilisateur. (Faire un truc semblable au contrôle parental de la Freebox.)

http://nsa33.casimages.com/img/2013/09/12/130912102531115594.png

Je pense donc à créer 168 checkbox pour définir la plage horaire.
Je voudrais récupérer le jour de la semaine exemple : Mercredi ainsi que l'heure sans les minutes si possible.
Ainsi je pourrais faire un code du genre :
        Dim Jour As String = Récupération Jour
        Dim Heure As String = Récupération Heure
        If ME18.Checked And Jour = "Mercredi" And Heure = "18" Then
            'Coupure Internet
        End If


Voilà je n'ai trouvé que cette solution, si vous avez mieux merci de me proposer.
Merci.
Afficher la suite 

Votre réponse

35 réponses

Messages postés
14297
Date d'inscription
vendredi 14 mars 2003
Statut
Modérateur
Dernière intervention
14 novembre 2018
- 12 sept. 2013 à 23:12
0
Merci
Regardes le type DateTime, tout est dedans (regardes aussi son ToString).
Commenter la réponse de NHenry
- 12 sept. 2013 à 23:20
0
Merci
Salut,

DateTime.Now.DayOfWeek.ToString et DateTime.Now.Hour.ToString
Commenter la réponse de Utilisateur anonyme
Messages postés
301
Date d'inscription
mercredi 22 septembre 2010
Dernière intervention
27 février 2018
- 21 sept. 2013 à 23:45
0
Merci
Bonjour à tous !
voici la solution que j'ai retenue. J'initialise un tableau de chexbox.
 Dim tab(7, 23) As CheckBox
Dim x
        Dim y = 425
        For jour = 0 To tab.GetLength(0) - 1
            x = -8
            For heure = 0 To tab.GetLength(1) - 1
                x = x + 20
                tab(jour, heure) = New CheckBox()
                tab(jour, heure).Left = x
                tab(jour, heure).Top = y
                tab(jour, heure).Width = 20
                Me.Controls.Add(tab(jour, heure))
            Next
            y = y + 20
        Next


Ensuite il faut tester chaque checkbox pour savoir si le jour et l'heure sont cochés (Voici un exemple pour le lundi à 00h00:
If tab(0, 0).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Monday And DateTime.Now.Hour = 0 Then
            CoupureInternet()
            My.Settings.LU0 = True 'Pour retenir que la checkbox est cochée
        Else
            RemiseInternet()
            My.Settings.LU0 = False
        End If


Voilà ! Merci à vous !
Commenter la réponse de CLeBeR_FR
Messages postés
3238
Date d'inscription
jeudi 26 novembre 2009
Dernière intervention
14 mars 2018
- 22 sept. 2013 à 09:10
0
Merci
Salut
c'est plutot

Dim tab(6, 23) As CheckBox
Commenter la réponse de cs_ShayW
Messages postés
18039
Date d'inscription
lundi 7 décembre 2009
Statut
Contributeur
Dernière intervention
11 avril 2018
- 22 sept. 2013 à 11:54
0
Merci
Bonjour,
tant de checkboxes = conception à revoir de A à Z , à mon sens !
Messages postés
378
Date d'inscription
samedi 22 septembre 2012
Dernière intervention
13 août 2017
- 24 sept. 2013 à 09:48
Bonjour FaonManager.
Malgré l'excellent conseil de ucfoutu, que je salue, vous ne bougez pas. Commencez donc à rédiger un cahier des charges clair, net, et précis, et demandez à une personne de confiance de le relire hors votre présence, puis de vous donner ses commentaires.
Salutations.
Commenter la réponse de ucfoutu
Messages postés
3238
Date d'inscription
jeudi 26 novembre 2009
Dernière intervention
14 mars 2018
- Modifié par cs_ShayW le 22/09/2013 à 22:38
0
Merci
Salut

evidemment 168 checkboxes ,heureusement que tu n'enregistes
pas les demi heure dans ce cas les checkboxes pousseraient comme des champignons après la pluie LOL

un peu complexe mais possible
tu peux faire ainsi
le tout dans un panel
un combobox avec les jours de la semaine
un CheckedListBox avec 24 heures de choix
un bouton pour valider,un bouton terminer,un bouton modifier

dans un autre panel
afficher les choix

si un item du combo n'a pas été choisi et aussi un/plusieurs item du listbox le bouton valider enabled = false
autrement true
je clique sur valider
il va falloir enregistrer les données dans my.setting
definir une structure de donnée

Private Structure Scheduler
        Public day As String
        Public fromto As String
    End Structure
    Private listscheduler As New List(Of Scheduler)


dans les settings on peut definir le type systemCollections.specialized.StringCollection
s'il n'est pas présent dans la listbox type qui s'ouvre tu as Browse... comme dernier item
clique dessus
dans la liste qui s'ouvre tu as un treeview avec des choix de type
cherche systemCollections.specialized
clique sur le + et choisis stringCollection
ainsi tu as ajouté un nouveau type à ton setting
par ex dans ton setting
name = maliste
type = systemCollections.specialized.StringCollection

pour enregister dans le settings
Private Sub SaveSheduler()
        For Each item As Scheduler In listscheduler
            My.Settings.list.Add(item.day)
            My.Settings.list.Add(item.fromto)
        Next
        My.Settings.Save()
    End Sub


pour écrire dans listscheduler
dans le click event du bouton valider
verifier que le jour et l'heure n'ont pas déja été choisi
si non ajouter à la list listscheduler
maintenant après avoir choisi le jour et l'heure

on peut soit ajouter un autre jour et autre heure
soit cliquer sur terminer
un autre problème qui survient dans le cas ou on veut
modifier ou annuler
un casse tete
je verrais demain
Commenter la réponse de cs_ShayW
Messages postés
3238
Date d'inscription
jeudi 26 novembre 2009
Dernière intervention
14 mars 2018
- 24 sept. 2013 à 10:37
0
Merci
Salut

avec un datagridview pour dépanner

 Private listhours As New List(Of String)
 Private Sub BuildListhours()
        Dim hoursstr As String
        For iter As Int32 = 0 To 23
            hoursstr = iter.ToString("D2") & "h:00 - " & (iter + 1).ToString("D2") & "h:00"
            listhours.Add(hoursstr)
        Next
    End Sub

    Private Sub DesignScheduler()
        Dim index, width, height As Integer
        Dim weekday() As String = {"Dim", "Lun", "Mar", "Mer", "Jeu", "Ven", "Sam"}
        BuildListhours()
        index = 0
        height = 0

        DataGridView1.RowHeadersWidthSizeMode = DataGridViewRowHeadersWidthSizeMode.AutoSizeToAllHeaders
        width = 0
        For col As Integer = 0 To 6
            DataGridView1.Columns.Add("col" & col.ToString, weekday(col))
            DataGridView1.Columns(col).ReadOnly = True
            width += DataGridView1.Columns(col).Width()

        Next

        For Each item As String In listhours
            DataGridView1.Rows.Add()
            DataGridView1.Rows(index).HeaderCell.Value = item
            height += DataGridView1.Rows(index).Height
            index += 1
        Next
        DataGridView1.AllowUserToAddRows = False
        DataGridView1.AllowUserToResizeRows = False
        DataGridView1.AllowUserToResizeColumns = False
        DataGridView1.Width = width + DataGridView1.RowHeadersWidth
        DataGridView1.Height = height
        DataGridView1.Location = New Point(3, 3)
    End Sub

    Private Sub DataGridView1_CellClick(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellClick
        If e.ColumnIndex < 0 Or e.RowIndex < 0 Then
            Exit Sub
        End If
        DataGridView1.ClearSelection()

        If DataGridView1.Rows(e.RowIndex).Cells(e.ColumnIndex).Style.BackColor = Color.RoyalBlue Then
            DataGridView1.Rows(e.RowIndex).Cells(e.ColumnIndex).Style.BackColor = Color.White
        Else
            DataGridView1.Rows(e.RowIndex).Cells(e.ColumnIndex).Style.BackColor = Color.RoyalBlue
        End If

    End Sub
Commenter la réponse de cs_ShayW
Messages postés
301
Date d'inscription
mercredi 22 septembre 2010
Dernière intervention
27 février 2018
- 25 sept. 2013 à 20:48
0
Merci
Très bien merci, je regarderai plus tard.
Commenter la réponse de CLeBeR_FR
- 27 sept. 2013 à 20:10
0
Merci
Heu... La question initiale demandait juste de récupérer le jour de la semaine et l'heure en cours. Mais j'ai surement mal compris la question ;)

"je regarderai plus tard"
Je comprends bien, tu n'auras que l'embarras du choix pour les réponses. 4 forums de programmation différents pour ta question! Tu n'y vas pas de main morte ;)
Commenter la réponse de Utilisateur anonyme
Messages postés
301
Date d'inscription
mercredi 22 septembre 2010
Dernière intervention
27 février 2018
- 27 sept. 2013 à 20:16
0
Merci
Oui, par contre je pense que je vais faire un combox dans lequel tu choisis l'heure à l'aide de 7 cases, ou autre solution je verrai.
Commenter la réponse de CLeBeR_FR
- 27 sept. 2013 à 20:24
0
Merci
Le mieux serait un combobox pour les jours et quatre (ou deux) NumericUpDown pour les plages horaires.
Commenter la réponse de Utilisateur anonyme
- 27 sept. 2013 à 21:08
0
Merci
Je suppose que tu auras plusieurs plages horaires dans une même semaine. Le plus simple finalement serait de regrouper ces plages dans un xml par exemple avec tes plages :
<plage>
    <nom>wednesday</nom>
    <debut>16</debut>
    <fin>18</fin>
</plage>
<plage>
     <nom>.wednesday</nom>
     <debut>10</debut>
     <fin>12</fin>
</plage>

Une simple classe comme celle-ci suffirait :
public class clsPlage
    public nom as string
    public debut as integer
    public fin as integer
end class

Enfin, une classe servant de container :
public class clsPlages
    public Plages as new list(of clsplage)
    sub new()
    end sub()
    sub add(element as clsPlage)
         plages.add(element)
    end sub
end class

Pour y insérer des données il te suffira de faire (les noms dans un combo et les heures dans des numericupdown) :
dim Plage1 as new clsPlage with {.nom = "monday", .debut = 15, .fin = 17}
dim Plage2 as new clsPlage with {.nom = "wednesday", .debut = 10, .fin = 12}
dim mesplages as new clsplages
mesplages.add(plage1)
mesplages.add(plage2)

Tu n'auras plus qu'a sérialiser le tout dans un xml :
dim ser as new xml.serialization.xmlserializer(gettype(clsplages))
using flux as new io.streamwriter("monfichier.xml") 
     ser.serialize(flux,mesplages)
end using


Enfin, pour relire ton fichier il faudra le déserialiser :
dim mesplages as new clsplages
dim deser as new xml.serialization.xmlserializer(gettype(clsplages))
using flux as new io.streamreader("monfichier.xml")
     mesplages = ctype(deser.deserialize(flux),clsplages)
end using

Enfin et pour finir, il faudra tester périodiquement qu'au moins un résultat soit retourné pour couper la connexion.
Dim requete As IEnumerable(Of String) = From valeur As clsPlage In mesplages.Plages _
                                                Where valeur.nom = DateTime.Now.DayOfWeek.ToString _
                                                And valeur.debut >= DateTime.Now.Hour _
                                                And valeur.fin <= DateTime.Now.Hour

If requete.Count > 0 Then
      'coupure internet
End If


Bon courage ...
Commenter la réponse de Utilisateur anonyme
- 27 sept. 2013 à 21:14
0
Merci
Un erreur s'est glissée dans mon code, il faut lire :
Dim requete As IEnumerable(Of clsPlage) = ....
Commenter la réponse de Utilisateur anonyme
Messages postés
3238
Date d'inscription
jeudi 26 novembre 2009
Dernière intervention
14 mars 2018
- 30 sept. 2013 à 15:01
0
Merci
Salut

voila ce que je propose
1 datagridview avec comme colonnes les jours de la semaine
rangées les heures de 00H à 24H
cellule couleur blanc = internet
cellule couleur bleue = couper
cliquer sur une cellule change de couleur
2 un bouton valider pour écrire dans un fichier xml

le code
 Imports System.IO
  Imports System.Xml.Serialization
  Public Enum week
        sunday
        monday
        tuesday
        wednesday
        thursday
        friday
        saturday
    End Enum

    Public Class Scheduler
        Public dayscheduller As week
        Public hours(23) As Boolean
    End Class

    Private Listscheduler As New List(Of Scheduler)
    Private coloryes As Color = Color.White
    Private colorno As Color = Color.CornflowerBlue
   Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
 DesignScheduler()
        InitListSheduler()
        LoadSheduler(Application.StartupPath & "SaveScheduler.xml")
        FillSheduller()
        ExecuteScheduler()
   end sub

   Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        'sauvegarder
        SaveScheduler()

    End Sub
    Private Sub BuildListhours()
        Dim hoursstr As String
        For iter As Int32 = 0 To 23
            hoursstr = iter.ToString("D2") & "h:00 - " & (iter + 1).ToString("D2") & "h:00"
            listhours.Add(hoursstr)
        Next
    End Sub

    Private Sub DesignScheduler()
        Dim index, width, height As Integer
        Dim weekday() As String = {"Dim", "Lun", "Mar", "Mer", "Jeu", "Ven", "Sam"}
        BuildListhours()
        index = 0
        height = 0

        DataGridView2.RowHeadersWidthSizeMode = DataGridViewRowHeadersWidthSizeMode.AutoSizeToAllHeaders
        width = 0
        For col As Integer = 0 To 6
            DataGridView2.Columns.Add("col" & col.ToString, weekday(col))
            DataGridView2.Columns(col).ReadOnly = True
            width += DataGridView2.Columns(col).Width()
        Next

        For Each item As String In listhours
            DataGridView2.Rows.Add()
            DataGridView2.Rows(index).HeaderCell.Value = item
            height += DataGridView2.Rows(index).Height
            index += 1
        Next
        For Each ro As DataGridViewRow In DataGridView2.Rows
            For Each cell As DataGridViewCell In ro.Cells
                cell.Tag = True
            Next
        Next
        DataGridView2.AllowUserToAddRows = False
        DataGridView2.AllowUserToResizeRows = False
        DataGridView2.AllowUserToResizeColumns = False
        DataGridView2.Width = width + DataGridView2.RowHeadersWidth
        DataGridView2.Height = height
        DataGridView2.Location = New Point(3, 3)
        
    End Sub

    Private Sub DataGridView2_CellClick(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView2.CellClick
        If e.ColumnIndex < 0 Or e.RowIndex < 0 Then
            Exit Sub
        End If
        DataGridView2.ClearSelection()

        If DataGridView2.Rows(e.RowIndex).Cells(e.ColumnIndex).Style.BackColor = colorno Then
            DataGridView2.Rows(e.RowIndex).Cells(e.ColumnIndex).Style.BackColor = coloryes
            DataGridView2.Rows(e.RowIndex).Cells(e.ColumnIndex).Tag = True
        Else
            DataGridView2.Rows(e.RowIndex).Cells(e.ColumnIndex).Style.BackColor = colorno
            DataGridView2.Rows(e.RowIndex).Cells(e.ColumnIndex).Tag = False
        End If

    End Sub
    Private Sub SaveScheduler()

        Dim myFileStream As New StreamWriter(Application.StartupPath & "SaveScheduler.xml")
        For itercol As Integer = 0 To DataGridView2.Columns.Count - 1
            For iterro As Integer = 0 To DataGridView2.Rows.Count - 1
                Listscheduler(itercol).hours(iterro) = DirectCast(DataGridView2.Rows(iterro).Cells(itercol).Tag, Boolean)
            Next
        Next
        Dim serialXML As Xml.Serialization.XmlSerializer = Nothing
        Try
            serialXML = New Xml.Serialization.XmlSerializer(GetType(Collections.Generic.List(Of Scheduler)))
            serialXML.Serialize(myFileStream, Listscheduler)
        Catch ex As Exception
            MessageBox.Show(ex.Message)
        End Try

        myFileStream.Close()
    End Sub
    Private Sub InitListSheduler()
        Dim dayweek As Array
        Listscheduler.Clear()
        dayweek = System.Enum.GetValues(GetType(week))
        For Each item As week In dayweek
            Dim myday As New Scheduler
            myday.dayscheduller = item
            For iter As Integer = 0 To myday.hours.Count - 1
                myday.hours(iter) = True
            Next
            Listscheduler.Add(myday)
        Next
    End Sub

    Private Sub FillSheduller()
        For Each item As Scheduler In Listscheduler
            For iterrow As Integer = 0 To item.hours.Count - 1
                DataGridView2.Rows(iterrow).Cells(item.dayscheduller).Tag = item.hours(iterrow)
                If item.hours(iterrow) Then
                    DataGridView2.Rows(iterrow).Cells(item.dayscheduller).Style.BackColor = coloryes
                Else
                    DataGridView2.Rows(iterrow).Cells(item.dayscheduller).Style.BackColor = colorno
                End If
            Next
        Next
    End Sub
    Private Sub LoadSheduler(ByVal xmlfile As String)
        Dim myFileStream As StreamReader = Nothing
        Dim serialXML As Xml.Serialization.XmlSerializer = Nothing

        Try
            If System.IO.File.Exists(xmlfile) Then
                Listscheduler.Clear()
                serialXML = New Xml.Serialization.XmlSerializer(GetType(Collections.Generic.List(Of Scheduler)))
                myFileStream = New StreamReader(xmlfile)
                Listscheduler = DirectCast(serialXML.Deserialize(myFileStream), Collections.Generic.List(Of Scheduler))
                myFileStream.Close()
            End If
        Catch ex As Exception
            MessageBox.Show(ex.Message)
        End Try


    End Sub

    Private Sub ExecuteScheduler()
 ' bloque ou permet l'internet 
        For Each item As Scheduler In Listscheduler
            If item.dayscheduller = DateTime.Now.DayOfWeek Then
                For iter As Integer = 0 To item.hours.Count - 1
                    If item.hours(iter) And iter = DateTime.Now.Hour Then
                        MessageBox.Show("Play")
                    End If
                    If Not item.hours(iter) And iter = DateTime.Now.Hour Then
                        MessageBox.Show("CUT")
                    End If

                Next
                
            End If
        Next
    End Sub 


ce que je ne comprend pas est ici la sub ExecuteScheduler
permet l'internet selon l'emploi tu temps
je l'ai appelé une fois dans le load event
mais il va falloir l'appeller toute les heures
Commenter la réponse de cs_ShayW
Messages postés
301
Date d'inscription
mercredi 22 septembre 2010
Dernière intervention
27 février 2018
- 8 oct. 2013 à 21:47
0
Merci
Merci pour vos réponses, je n'ai pas encore lancé la bêta de mon programme, j'attends l'avis des utilisateurs pour voir si je modifier mes 168 checkbox !
Messages postés
301
Date d'inscription
mercredi 22 septembre 2010
Dernière intervention
27 février 2018
- 9 oct. 2013 à 16:32
Public Class FormGrilleLimitationAcces
    Dim tab(7, 23) As CheckBox
    Private Sub FormGrilleLimitationAcces_Load(sender As Object, e As EventArgs) Handles MyBase.Load

        Dim x
        Dim y = 104
        For jour = 0 To tab.GetLength(0) - 1
            x = 216
            For heure = 0 To tab.GetLength(1) - 1
                x = x + 15
                tab(jour, heure) = New CheckBox()
                tab(jour, heure).Left = x
                tab(jour, heure).Top = y
                tab(jour, heure).Width = 15
                Me.Controls.Add(tab(jour, heure))
            Next
            y = y + 20
        Next
    End Sub
    Public Sub RemiseInternet()
        Shell("cmd.exe /C ipconfig /renew", AppWinStyle.Hide)
    End Sub

    Public Sub CoupureInternet()
        Shell("cmd.exe /C ipconfig /release", AppWinStyle.Hide)
    End Sub

    Public Sub VerificationConnexionInternet()

        If tab(0, 0).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Monday And DateTime.Now.Hour = 0 Then
            CoupureInternet()
            My.Settings.LU0 = True
        Else
            RemiseInternet()
            My.Settings.LU0 = False
        End If

        If tab(0, 1).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Monday And DateTime.Now.Hour = 1 Then
            CoupureInternet()
            My.Settings.LU1 = True
        Else
            RemiseInternet()
            My.Settings.LU1 = False
        End If

        If tab(0, 2).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Monday And DateTime.Now.Hour = 2 Then
            CoupureInternet()
            My.Settings.LU2 = True
        Else
            RemiseInternet()
            My.Settings.LU2 = False
        End If

        If tab(0, 3).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Monday And DateTime.Now.Hour = 3 Then
            CoupureInternet()
            My.Settings.LU3 = True
        Else
            RemiseInternet()
            My.Settings.LU3 = False
        End If

        If tab(0, 4).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Monday And DateTime.Now.Hour = 4 Then
            CoupureInternet()
            My.Settings.LU4 = True
        Else
            RemiseInternet()
            My.Settings.LU4 = False
        End If

        If tab(0, 5).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Monday And DateTime.Now.Hour = 5 Then
            CoupureInternet()
            My.Settings.LU5 = True
        Else
            RemiseInternet()
            My.Settings.LU5 = False
        End If

        If tab(0, 6).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Monday And DateTime.Now.Hour = 6 Then
            CoupureInternet()
            My.Settings.LU6 = True
        Else
            RemiseInternet()
            My.Settings.LU6 = False
        End If

        If tab(0, 7).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Monday And DateTime.Now.Hour = 7 Then
            CoupureInternet()
            My.Settings.LU7 = True
        Else
            RemiseInternet()
            My.Settings.LU7 = False
        End If

        If tab(0, 8).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Monday And DateTime.Now.Hour = 8 Then
            CoupureInternet()
            My.Settings.LU8 = True
        Else
            RemiseInternet()
            My.Settings.LU8 = False
        End If

        If tab(0, 9).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Monday And DateTime.Now.Hour = 9 Then
            CoupureInternet()
            My.Settings.LU9 = True
        Else
            RemiseInternet()
            My.Settings.LU9 = False
        End If

        If tab(0, 10).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Monday And DateTime.Now.Hour = 10 Then
            CoupureInternet()
            My.Settings.LU10 = True
        Else
            RemiseInternet()
            My.Settings.LU10 = False
        End If

        If tab(0, 11).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Monday And DateTime.Now.Hour = 11 Then
            CoupureInternet()
            My.Settings.LU11 = True
        Else
            RemiseInternet()
            My.Settings.LU11 = False
        End If

        If tab(0, 12).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Monday And DateTime.Now.Hour = 12 Then
            CoupureInternet()
            My.Settings.LU12 = True
        Else
            RemiseInternet()
            My.Settings.LU12 = False
        End If

        If tab(0, 13).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Monday And DateTime.Now.Hour = 13 Then
            CoupureInternet()
            My.Settings.LU13 = True
        Else
            RemiseInternet()
            My.Settings.LU13 = False
        End If

        If tab(0, 14).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Monday And DateTime.Now.Hour = 14 Then
            CoupureInternet()
            My.Settings.LU14 = True
        Else
            RemiseInternet()
            My.Settings.LU14 = False
        End If

        If tab(0, 15).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Monday And DateTime.Now.Hour = 15 Then
            CoupureInternet()
            My.Settings.LU15 = True
        Else
            RemiseInternet()
            My.Settings.LU15 = False
        End If

        If tab(0, 16).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Monday And DateTime.Now.Hour = 16 Then
            CoupureInternet()
            My.Settings.LU16 = True
        Else
            RemiseInternet()
            My.Settings.LU16 = False
        End If

        If tab(0, 17).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Monday And DateTime.Now.Hour = 17 Then
            CoupureInternet()
            My.Settings.LU17 = True
        Else
            RemiseInternet()
            My.Settings.LU17 = False
        End If

        If tab(0, 18).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Monday And DateTime.Now.Hour = 18 Then
            CoupureInternet()
            My.Settings.LU18 = True
        Else
            RemiseInternet()
            My.Settings.LU18 = False
        End If

        If tab(0, 19).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Monday And DateTime.Now.Hour = 19 Then
            CoupureInternet()
            My.Settings.LU19 = True
        Else
            RemiseInternet()
            My.Settings.LU19 = False
        End If

        If tab(0, 20).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Monday And DateTime.Now.Hour = 20 Then
            CoupureInternet()
            My.Settings.LU20 = True
        Else
            RemiseInternet()
            My.Settings.LU20 = False
        End If

        If tab(0, 21).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Monday And DateTime.Now.Hour = 21 Then
            CoupureInternet()
            My.Settings.LU21 = True
        Else
            RemiseInternet()
            My.Settings.LU21 = False
        End If

        If tab(0, 22).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Monday And DateTime.Now.Hour = 22 Then
            CoupureInternet()
            My.Settings.LU22 = True
        Else
            RemiseInternet()
            My.Settings.LU22 = False
        End If

        If tab(0, 23).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Monday And DateTime.Now.Hour = 23 Then
            CoupureInternet()
            My.Settings.LU23 = True
        Else
            RemiseInternet()
            My.Settings.LU23 = False
        End If


        If tab(1, 0).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Thursday And DateTime.Now.Hour = 0 Then
            CoupureInternet()
            My.Settings.MA0 = True
        Else
            RemiseInternet()
            My.Settings.MA0 = False
        End If

        If tab(1, 1).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Thursday And DateTime.Now.Hour = 1 Then
            CoupureInternet()
            My.Settings.MA1 = True
        Else
            RemiseInternet()
            My.Settings.MA1 = False
        End If

        If tab(1, 2).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Thursday And DateTime.Now.Hour = 2 Then
            CoupureInternet()
            My.Settings.MA2 = True
        Else
            RemiseInternet()
            My.Settings.MA2 = False
        End If

        If tab(1, 3).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Thursday And DateTime.Now.Hour = 3 Then
            CoupureInternet()
            My.Settings.MA3 = True
        Else
            RemiseInternet()
            My.Settings.MA3 = False
        End If

        If tab(1, 4).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Thursday And DateTime.Now.Hour = 4 Then
            CoupureInternet()
            My.Settings.MA4 = True
        Else
            RemiseInternet()
            My.Settings.MA4 = False
        End If

        If tab(1, 5).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Thursday And DateTime.Now.Hour = 5 Then
            CoupureInternet()
            My.Settings.MA5 = True
        Else
            RemiseInternet()
            My.Settings.MA5 = False
        End If

        If tab(1, 6).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Thursday And DateTime.Now.Hour = 6 Then
            CoupureInternet()
            My.Settings.MA6 = True
        Else
            RemiseInternet()
            My.Settings.MA6 = False
        End If

        If tab(1, 7).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Thursday And DateTime.Now.Hour = 7 Then
            CoupureInternet()
            My.Settings.MA7 = True
        Else
            RemiseInternet()
            My.Settings.MA7 = False
        End If

        If tab(1, 8).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Thursday And DateTime.Now.Hour = 8 Then
            CoupureInternet()
            My.Settings.MA8 = True
        Else
            RemiseInternet()
            My.Settings.MA8 = False
        End If

        If tab(1, 9).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Thursday And DateTime.Now.Hour = 9 Then
            CoupureInternet()
            My.Settings.MA9 = True
        Else
            RemiseInternet()
            My.Settings.MA9 = False
        End If

        If tab(1, 11).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Thursday And DateTime.Now.Hour = 11 Then
            CoupureInternet()
            My.Settings.MA11 = True
        Else
            RemiseInternet()
            My.Settings.MA11 = False
        End If

        If tab(1, 11).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Thursday And DateTime.Now.Hour = 11 Then
            CoupureInternet()
            My.Settings.MA11 = True
        Else
            RemiseInternet()
            My.Settings.MA11 = False
        End If

        If tab(1, 12).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Thursday And DateTime.Now.Hour = 12 Then
            CoupureInternet()
            My.Settings.MA12 = True
        Else
            RemiseInternet()
            My.Settings.MA12 = False
        End If

        If tab(1, 13).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Thursday And DateTime.Now.Hour = 13 Then
            CoupureInternet()
            My.Settings.MA13 = True
        Else
            RemiseInternet()
            My.Settings.MA13 = False
        End If

        If tab(1, 14).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Thursday And DateTime.Now.Hour = 14 Then
            CoupureInternet()
            My.Settings.MA14 = True
        Else
            RemiseInternet()
            My.Settings.MA14 = False
        End If

        If tab(1, 15).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Thursday And DateTime.Now.Hour = 15 Then
            CoupureInternet()
            My.Settings.MA15 = True
        Else
            RemiseInternet()
            My.Settings.MA15 = False
        End If

        If tab(1, 16).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Thursday And DateTime.Now.Hour = 16 Then
            CoupureInternet()
            My.Settings.MA16 = True
        Else
            RemiseInternet()
            My.Settings.MA16 = False
        End If

        If tab(1, 17).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Thursday And DateTime.Now.Hour = 17 Then
            CoupureInternet()
            My.Settings.MA17 = True
        Else
            RemiseInternet()
            My.Settings.MA17 = False
        End If

        If tab(1, 18).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Thursday And DateTime.Now.Hour = 18 Then
            CoupureInternet()
            My.Settings.MA18 = True
        Else
            RemiseInternet()
            My.Settings.MA18 = False
        End If

        If tab(1, 19).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Thursday And DateTime.Now.Hour = 19 Then
            CoupureInternet()
            My.Settings.MA19 = True
        Else
            RemiseInternet()
            My.Settings.MA19 = False
        End If

        If tab(1, 21).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Thursday And DateTime.Now.Hour = 21 Then
            CoupureInternet()
            My.Settings.MA21 = True
        Else
            RemiseInternet()
            My.Settings.MA21 = False
        End If

        If tab(1, 21).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Thursday And DateTime.Now.Hour = 21 Then
            CoupureInternet()
            My.Settings.MA21 = True
        Else
            RemiseInternet()
            My.Settings.MA21 = False
        End If

        If tab(1, 22).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Thursday And DateTime.Now.Hour = 22 Then
            CoupureInternet()
            My.Settings.MA22 = True
        Else
            RemiseInternet()
            My.Settings.MA22 = False
        End If

        If tab(1, 23).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Thursday And DateTime.Now.Hour = 23 Then
            CoupureInternet()
            My.Settings.MA23 = True
        Else
            RemiseInternet()
            My.Settings.MA23 = False
        End If

        If tab(2, 0).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Wednesday And DateTime.Now.Hour = 0 Then
            CoupureInternet()
            My.Settings.ME0 = True
        Else
            RemiseInternet()
            My.Settings.ME0 = False
        End If

        If tab(2, 1).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Wednesday And DateTime.Now.Hour = 1 Then
            CoupureInternet()
            My.Settings.ME1 = True
        Else
            RemiseInternet()
            My.Settings.ME1 = False
        End If

        If tab(2, 2).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Wednesday And DateTime.Now.Hour = 2 Then
            CoupureInternet()
            My.Settings.ME2 = True
        Else
            RemiseInternet()
            My.Settings.ME2 = False
        End If

        If tab(2, 3).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Wednesday And DateTime.Now.Hour = 3 Then
            CoupureInternet()
            My.Settings.ME3 = True
        Else
            RemiseInternet()
            My.Settings.ME3 = False
        End If

        If tab(2, 4).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Wednesday And DateTime.Now.Hour = 4 Then
            CoupureInternet()
            My.Settings.ME4 = True
        Else
            RemiseInternet()
            My.Settings.ME4 = False
        End If

        If tab(2, 5).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Wednesday And DateTime.Now.Hour = 5 Then
            CoupureInternet()
            My.Settings.ME5 = True
        Else
            RemiseInternet()
            My.Settings.ME5 = False
        End If

        If tab(2, 6).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Wednesday And DateTime.Now.Hour = 6 Then
            CoupureInternet()
            My.Settings.ME6 = True
        Else
            RemiseInternet()
            My.Settings.ME6 = False
        End If

        If tab(2, 7).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Wednesday And DateTime.Now.Hour = 7 Then
            CoupureInternet()
            My.Settings.ME7 = True
        Else
            RemiseInternet()
            My.Settings.ME7 = False
        End If

        If tab(2, 8).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Wednesday And DateTime.Now.Hour = 8 Then
            CoupureInternet()
            My.Settings.ME8 = True
        Else
            RemiseInternet()
            My.Settings.ME8 = False
        End If

        If tab(2, 9).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Wednesday And DateTime.Now.Hour = 9 Then
            CoupureInternet()
            My.Settings.ME9 = True
        Else
            RemiseInternet()
            My.Settings.ME9 = False
        End If

        If tab(2, 10).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Wednesday And DateTime.Now.Hour = 10 Then
            CoupureInternet()
            My.Settings.ME10 = True
        Else
            RemiseInternet()
            My.Settings.ME10 = False
        End If

        If tab(2, 11).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Wednesday And DateTime.Now.Hour = 11 Then
            CoupureInternet()
            My.Settings.ME11 = True
        Else
            RemiseInternet()
            My.Settings.ME11 = False
        End If

        If tab(2, 12).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Wednesday And DateTime.Now.Hour = 12 Then
            CoupureInternet()
            My.Settings.ME12 = True
        Else
            RemiseInternet()
            My.Settings.ME12 = False
        End If

        If tab(2, 13).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Wednesday And DateTime.Now.Hour = 13 Then
            CoupureInternet()
            My.Settings.ME13 = True
        Else
            RemiseInternet()
            My.Settings.ME13 = False
        End If

        If tab(2, 14).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Wednesday And DateTime.Now.Hour = 14 Then
            CoupureInternet()
            My.Settings.ME14 = True
        Else
            RemiseInternet()
            My.Settings.ME14 = False
        End If

        If tab(2, 15).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Wednesday And DateTime.Now.Hour = 15 Then
            CoupureInternet()
            My.Settings.ME15 = True
        Else
            RemiseInternet()
            My.Settings.ME15 = False
        End If

        If tab(2, 16).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Wednesday And DateTime.Now.Hour = 16 Then
            CoupureInternet()
            My.Settings.ME16 = True
        Else
            RemiseInternet()
            My.Settings.ME16 = False
        End If

        If tab(2, 17).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Wednesday And DateTime.Now.Hour = 17 Then
            CoupureInternet()
            My.Settings.ME17 = True
        Else
            RemiseInternet()
            My.Settings.ME17 = False
        End If

        If tab(2, 18).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Wednesday And DateTime.Now.Hour = 18 Then
            CoupureInternet()
            My.Settings.ME18 = True
        Else
            RemiseInternet()
            My.Settings.ME18 = False
        End If

        If tab(2, 19).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Wednesday And DateTime.Now.Hour = 19 Then
            CoupureInternet()
            My.Settings.ME19 = True
        Else
            RemiseInternet()
            My.Settings.ME19 = False
        End If

        If tab(2, 20).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Wednesday And DateTime.Now.Hour = 20 Then
            CoupureInternet()
            My.Settings.ME20 = True
        Else
            RemiseInternet()
            My.Settings.ME20 = False
        End If

        If tab(2, 21).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Wednesday And DateTime.Now.Hour = 21 Then
            CoupureInternet()
            My.Settings.ME21 = True
        Else
            RemiseInternet()
            My.Settings.ME21 = False
        End If

        If tab(2, 22).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Wednesday And DateTime.Now.Hour = 22 Then
            CoupureInternet()
            My.Settings.ME22 = True
        Else
            RemiseInternet()
            My.Settings.ME22 = False
        End If

        If tab(2, 23).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Wednesday And DateTime.Now.Hour = 23 Then
            CoupureInternet()
            My.Settings.ME23 = True
        Else
            RemiseInternet()
            My.Settings.ME23 = False
        End If

        If tab(3, 0).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Tuesday And DateTime.Now.Hour = 0 Then
            CoupureInternet()
            My.Settings.JE0 = True
        Else
            RemiseInternet()
            My.Settings.JE0 = False
        End If

        If tab(3, 1).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Tuesday And DateTime.Now.Hour = 1 Then
            CoupureInternet()
            My.Settings.JE1 = True
        Else
            RemiseInternet()
            My.Settings.JE1 = False
        End If

        If tab(3, 2).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Tuesday And DateTime.Now.Hour = 2 Then
            CoupureInternet()
            My.Settings.JE2 = True
        Else
            RemiseInternet()
            My.Settings.JE2 = False
        End If

        If tab(3, 3).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Tuesday And DateTime.Now.Hour = 3 Then
            CoupureInternet()
            My.Settings.JE3 = True
        Else
            RemiseInternet()
            My.Settings.JE3 = False
        End If

        If tab(3, 4).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Tuesday And DateTime.Now.Hour = 4 Then
            CoupureInternet()
            My.Settings.JE4 = True
        Else
            RemiseInternet()
            My.Settings.JE4 = False
        End If

        If tab(3, 5).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Tuesday And DateTime.Now.Hour = 5 Then
            CoupureInternet()
            My.Settings.JE5 = True
        Else
            RemiseInternet()
            My.Settings.JE5 = False
        End If

        If tab(3, 6).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Tuesday And DateTime.Now.Hour = 6 Then
            CoupureInternet()
            My.Settings.JE6 = True
        Else
            RemiseInternet()
            My.Settings.JE6 = False
        End If

        If tab(3, 7).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Tuesday And DateTime.Now.Hour = 7 Then
            CoupureInternet()
            My.Settings.JE7 = True
        Else
            RemiseInternet()
            My.Settings.JE7 = False
        End If

        If tab(3, 8).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Tuesday And DateTime.Now.Hour = 8 Then
            CoupureInternet()
            My.Settings.JE8 = True
        Else
            RemiseInternet()
            My.Settings.JE8 = False
        End If

        If tab(3, 9).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Tuesday And DateTime.Now.Hour = 9 Then
            CoupureInternet()
            My.Settings.JE9 = True
        Else
            RemiseInternet()
            My.Settings.JE9 = False
        End If

        If tab(3, 10).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Tuesday And DateTime.Now.Hour = 10 Then
            CoupureInternet()
            My.Settings.JE10 = True
        Else
            RemiseInternet()
            My.Settings.JE10 = False
        End If

        If tab(3, 11).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Tuesday And DateTime.Now.Hour = 11 Then
            CoupureInternet()
            My.Settings.JE11 = True
        Else
            RemiseInternet()
            My.Settings.JE11 = False
        End If

        If tab(3, 12).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Tuesday And DateTime.Now.Hour = 12 Then
            CoupureInternet()
            My.Settings.JE12 = True
        Else
            RemiseInternet()
            My.Settings.JE12 = False
        End If

        If tab(3, 13).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Tuesday And DateTime.Now.Hour = 13 Then
            CoupureInternet()
            My.Settings.JE13 = True
        Else
            RemiseInternet()
            My.Settings.JE13 = False
        End If

        If tab(3, 13).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Tuesday And DateTime.Now.Hour = 13 Then
            CoupureInternet()
            My.Settings.JE13 = True
        Else
            RemiseInternet()
            My.Settings.JE13 = False
        End If

        If tab(3, 15).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Tuesday And DateTime.Now.Hour = 15 Then
            CoupureInternet()
            My.Settings.JE15 = True
        Else
            RemiseInternet()
            My.Settings.JE15 = False
        End If

        If tab(3, 16).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Tuesday And DateTime.Now.Hour = 16 Then
            CoupureInternet()
            My.Settings.JE16 = True
        Else
            RemiseInternet()
            My.Settings.JE16 = False
        End If

        If tab(3, 17).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Tuesday And DateTime.Now.Hour = 17 Then
            CoupureInternet()
            My.Settings.JE17 = True
        Else
            RemiseInternet()
            My.Settings.JE17 = False
        End If

        If tab(3, 18).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Tuesday And DateTime.Now.Hour = 18 Then
            CoupureInternet()
            My.Settings.JE18 = True
        Else
            RemiseInternet()
            My.Settings.JE18 = False
        End If

        If tab(3, 19).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Tuesday And DateTime.Now.Hour = 19 Then
            CoupureInternet()
            My.Settings.JE19 = True
        Else
            RemiseInternet()
            My.Settings.JE19 = False
        End If

        If tab(3, 20).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Tuesday And DateTime.Now.Hour = 20 Then
            CoupureInternet()
            My.Settings.JE20 = True
        Else
            RemiseInternet()
            My.Settings.JE20 = False
        End If

        If tab(3, 21).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Tuesday And DateTime.Now.Hour = 21 Then
            CoupureInternet()
            My.Settings.JE21 = True
        Else
            RemiseInternet()
            My.Settings.JE21 = False
        End If

        If tab(3, 22).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Tuesday And DateTime.Now.Hour = 22 Then
            CoupureInternet()
            My.Settings.JE22 = True
        Else
            RemiseInternet()
            My.Settings.JE22 = False
        End If

        If tab(3, 23).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Tuesday And DateTime.Now.Hour = 23 Then
            CoupureInternet()
            My.Settings.JE23 = True
        Else
            RemiseInternet()
            My.Settings.JE23 = False
        End If


        If tab(4, 0).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Friday And DateTime.Now.Hour = 0 Then
            CoupureInternet()
            My.Settings.VE0 = True
        Else
            RemiseInternet()
            My.Settings.VE0 = False
        End If

        If tab(4, 1).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Friday And DateTime.Now.Hour = 1 Then
            CoupureInternet()
            My.Settings.VE1 = True
        Else
            RemiseInternet()
            My.Settings.VE1 = False
        End If

        If tab(4, 2).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Friday And DateTime.Now.Hour = 2 Then
            CoupureInternet()
            My.Settings.VE2 = True
        Else
            RemiseInternet()
            My.Settings.VE2 = False
        End If

        If tab(4, 3).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Friday And DateTime.Now.Hour = 3 Then
            CoupureInternet()
            My.Settings.VE3 = True
        Else
            RemiseInternet()
            My.Settings.VE3 = False
        End If

        If tab(4, 4).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Friday And DateTime.Now.Hour = 4 Then
            CoupureInternet()
            My.Settings.VE4 = True
        Else
            RemiseInternet()
            My.Settings.VE4 = False
        End If

        If tab(4, 5).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Friday And DateTime.Now.Hour = 5 Then
            CoupureInternet()
            My.Settings.VE5 = True
        Else
            RemiseInternet()
            My.Settings.VE5 = False
        End If

        If tab(4, 6).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Friday And DateTime.Now.Hour = 6 Then
            CoupureInternet()
            My.Settings.VE6 = True
        Else
            RemiseInternet()
            My.Settings.VE6 = False
        End If

        If tab(4, 7).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Friday And DateTime.Now.Hour = 7 Then
            CoupureInternet()
            My.Settings.VE7 = True
        Else
            RemiseInternet()
            My.Settings.VE7 = False
        End If

        If tab(4, 8).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Friday And DateTime.Now.Hour = 8 Then
            CoupureInternet()
            My.Settings.VE8 = True
        Else
            RemiseInternet()
            My.Settings.VE8 = False
        End If

        If tab(4, 9).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Friday And DateTime.Now.Hour = 9 Then
            CoupureInternet()
            My.Settings.VE9 = True
        Else
            RemiseInternet()
            My.Settings.VE9 = False
        End If

        If tab(4, 10).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Friday And DateTime.Now.Hour = 10 Then
            CoupureInternet()
            My.Settings.VE10 = True
        Else
            RemiseInternet()
            My.Settings.VE10 = False
        End If

        If tab(4, 11).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Friday And DateTime.Now.Hour = 11 Then
            CoupureInternet()
            My.Settings.VE11 = True
        Else
            RemiseInternet()
            My.Settings.VE11 = False
        End If

        If tab(4, 12).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Friday And DateTime.Now.Hour = 12 Then
            CoupureInternet()
            My.Settings.VE12 = True
        Else
            RemiseInternet()
            My.Settings.VE12 = False
        End If

        If tab(4, 13).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Friday And DateTime.Now.Hour = 13 Then
            CoupureInternet()
            My.Settings.VE13 = True
        Else
            RemiseInternet()
            My.Settings.VE13 = False
        End If

        If tab(4, 14).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Friday And DateTime.Now.Hour = 14 Then
            CoupureInternet()
            My.Settings.VE14 = True
        Else
            RemiseInternet()
            My.Settings.VE14 = False
        End If

        If tab(4, 15).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Friday And DateTime.Now.Hour = 15 Then
            CoupureInternet()
            My.Settings.VE15 = True
        Else
            RemiseInternet()
            My.Settings.VE15 = False
        End If

        If tab(4, 16).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Friday And DateTime.Now.Hour = 16 Then
            CoupureInternet()
            My.Settings.VE16 = True
        Else
            RemiseInternet()
            My.Settings.VE16 = False
        End If

        If tab(4, 17).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Friday And DateTime.Now.Hour = 17 Then
            CoupureInternet()
            My.Settings.VE17 = True
        Else
            RemiseInternet()
            My.Settings.VE17 = False
        End If

        If tab(4, 18).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Friday And DateTime.Now.Hour = 18 Then
            CoupureInternet()
            My.Settings.VE18 = True
        Else
            RemiseInternet()
            My.Settings.VE18 = False
        End If

        If tab(4, 19).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Friday And DateTime.Now.Hour = 19 Then
            CoupureInternet()
            My.Settings.VE19 = True
        Else
            RemiseInternet()
            My.Settings.VE19 = False
        End If

        If tab(4, 20).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Friday And DateTime.Now.Hour = 20 Then
            CoupureInternet()
            My.Settings.VE20 = True
        Else
            RemiseInternet()
            My.Settings.VE20 = False
        End If

        If tab(4, 21).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Friday And DateTime.Now.Hour = 21 Then
            CoupureInternet()
            My.Settings.VE21 = True
        Else
            RemiseInternet()
            My.Settings.VE21 = False
        End If

        If tab(4, 22).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Friday And DateTime.Now.Hour = 22 Then
            CoupureInternet()
            My.Settings.VE22 = True
        Else
            RemiseInternet()
            My.Settings.VE22 = False
        End If

        If tab(4, 23).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Friday And DateTime.Now.Hour = 23 Then
            CoupureInternet()
            My.Settings.VE23 = True
        Else
            RemiseInternet()
            My.Settings.VE23 = False
        End If


        If tab(5, 0).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Saturday And DateTime.Now.Hour = 0 Then
            CoupureInternet()
            My.Settings.SA0 = True
        Else
            RemiseInternet()
            My.Settings.SA0 = False
        End If

        If tab(5, 1).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Saturday And DateTime.Now.Hour = 1 Then
            CoupureInternet()
            My.Settings.SA1 = True
        Else
            RemiseInternet()
            My.Settings.SA1 = False
        End If

        If tab(5, 2).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Saturday And DateTime.Now.Hour = 2 Then
            CoupureInternet()
            My.Settings.SA2 = True
        Else
            RemiseInternet()
            My.Settings.SA2 = False
        End If

        If tab(5, 3).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Saturday And DateTime.Now.Hour = 3 Then
            CoupureInternet()
            My.Settings.SA3 = True
        Else
            RemiseInternet()
            My.Settings.SA3 = False
        End If

        If tab(5, 4).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Saturday And DateTime.Now.Hour = 4 Then
            CoupureInternet()
            My.Settings.SA4 = True
        Else
            RemiseInternet()
            My.Settings.SA4 = False
        End If

        If tab(5, 5).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Saturday And DateTime.Now.Hour = 5 Then
            CoupureInternet()
            My.Settings.SA5 = True
        Else
            RemiseInternet()
            My.Settings.SA5 = False
        End If

        If tab(5, 6).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Saturday And DateTime.Now.Hour = 6 Then
            CoupureInternet()
            My.Settings.SA6 = True
        Else
            RemiseInternet()
            My.Settings.SA6 = False
        End If

        If tab(5, 7).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Saturday And DateTime.Now.Hour = 7 Then
            CoupureInternet()
            My.Settings.SA7 = True
        Else
            RemiseInternet()
            My.Settings.SA7 = False
        End If

        If tab(5, 8).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Saturday And DateTime.Now.Hour = 8 Then
            CoupureInternet()
            My.Settings.SA8 = True
        Else
            RemiseInternet()
            My.Settings.SA8 = False
        End If

        If tab(5, 9).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Saturday And DateTime.Now.Hour = 9 Then
            CoupureInternet()
            My.Settings.SA9 = True
        Else
            RemiseInternet()
            My.Settings.SA9 = False
        End If

        If tab(5, 10).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Saturday And DateTime.Now.Hour = 10 Then
            CoupureInternet()
            My.Settings.SA10 = True
        Else
            RemiseInternet()
            My.Settings.SA10 = False
        End If

        If tab(5, 11).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Saturday And DateTime.Now.Hour = 11 Then
            CoupureInternet()
            My.Settings.SA11 = True
        Else
            RemiseInternet()
            My.Settings.SA11 = False
        End If

        If tab(5, 12).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Saturday And DateTime.Now.Hour = 12 Then
            CoupureInternet()
            My.Settings.SA12 = True
        Else
            RemiseInternet()
            My.Settings.SA12 = False
        End If

        If tab(5, 13).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Saturday And DateTime.Now.Hour = 13 Then
            CoupureInternet()
            My.Settings.SA13 = True
        Else
            RemiseInternet()
            My.Settings.SA13 = False
        End If

        If tab(5, 15).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Saturday And DateTime.Now.Hour = 15 Then
            CoupureInternet()
            My.Settings.SA15 = True
        Else
            RemiseInternet()
            My.Settings.SA15 = False
        End If

        If tab(5, 15).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Saturday And DateTime.Now.Hour = 15 Then
            CoupureInternet()
            My.Settings.SA15 = True
        Else
            RemiseInternet()
            My.Settings.SA15 = False
        End If

        If tab(5, 16).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Saturday And DateTime.Now.Hour = 16 Then
            CoupureInternet()
            My.Settings.SA16 = True
        Else
            RemiseInternet()
            My.Settings.SA16 = False
        End If

        If tab(5, 17).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Saturday And DateTime.Now.Hour = 17 Then
            CoupureInternet()
            My.Settings.SA17 = True
        Else
            RemiseInternet()
            My.Settings.SA17 = False
        End If

        If tab(5, 18).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Saturday And DateTime.Now.Hour = 18 Then
            CoupureInternet()
            My.Settings.SA18 = True
        Else
            RemiseInternet()
            My.Settings.SA18 = False
        End If

        If tab(5, 19).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Saturday And DateTime.Now.Hour = 19 Then
            CoupureInternet()
            My.Settings.SA19 = True
        Else
            RemiseInternet()
            My.Settings.SA19 = False
        End If

        If tab(5, 20).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Saturday And DateTime.Now.Hour = 20 Then
            CoupureInternet()
            My.Settings.SA20 = True
        Else
            RemiseInternet()
            My.Settings.SA20 = False
        End If

        If tab(5, 21).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Saturday And DateTime.Now.Hour = 21 Then
            CoupureInternet()
            My.Settings.SA21 = True
        Else
            RemiseInternet()
            My.Settings.SA21 = False
        End If

        If tab(5, 22).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Saturday And DateTime.Now.Hour = 22 Then
            CoupureInternet()
            My.Settings.SA22 = True
        Else
            RemiseInternet()
            My.Settings.SA22 = False
        End If

        If tab(5, 23).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Saturday And DateTime.Now.Hour = 23 Then
            CoupureInternet()
            My.Settings.SA23 = True
        Else
            RemiseInternet()
            My.Settings.SA23 = False
        End If


        If tab(6, 0).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Sunday And DateTime.Now.Hour = 0 Then
            CoupureInternet()
            My.Settings.DI0 = True
        Else
            RemiseInternet()
            My.Settings.DI0 = False
        End If

        If tab(6, 1).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Sunday And DateTime.Now.Hour = 1 Then
            CoupureInternet()
            My.Settings.DI1 = True
        Else
            RemiseInternet()
            My.Settings.DI1 = False
        End If

        If tab(6, 2).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Sunday And DateTime.Now.Hour = 2 Then
            CoupureInternet()
            My.Settings.DI2 = True
        Else
            RemiseInternet()
            My.Settings.DI2 = False
        End If

        If tab(6, 3).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Sunday And DateTime.Now.Hour = 3 Then
            CoupureInternet()
            My.Settings.DI3 = True
        Else
            RemiseInternet()
            My.Settings.DI3 = False
        End If

        If tab(6, 4).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Sunday And DateTime.Now.Hour = 4 Then
            CoupureInternet()
            My.Settings.DI4 = True
        Else
            RemiseInternet()
            My.Settings.DI4 = False
        End If

        If tab(6, 5).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Sunday And DateTime.Now.Hour = 5 Then
            CoupureInternet()
            My.Settings.DI5 = True
        Else
            RemiseInternet()
            My.Settings.DI5 = False
        End If

        If tab(6, 6).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Sunday And DateTime.Now.Hour = 6 Then
            CoupureInternet()
            My.Settings.DI6 = True
        Else
            RemiseInternet()
            My.Settings.DI6 = False
        End If

        If tab(6, 7).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Sunday And DateTime.Now.Hour = 7 Then
            CoupureInternet()
            My.Settings.DI7 = True
        Else
            RemiseInternet()
            My.Settings.DI7 = False
        End If

        If tab(6, 8).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Sunday And DateTime.Now.Hour = 8 Then
            CoupureInternet()
            My.Settings.DI8 = True
        Else
            RemiseInternet()
            My.Settings.DI8 = False
        End If

        If tab(6, 9).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Sunday And DateTime.Now.Hour = 9 Then
            CoupureInternet()
            My.Settings.DI9 = True
        Else
            RemiseInternet()
            My.Settings.DI9 = False
        End If

        If tab(6, 10).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Sunday And DateTime.Now.Hour = 10 Then
            CoupureInternet()
            My.Settings.DI10 = True
        Else
            RemiseInternet()
            My.Settings.DI10 = False
        End If

        If tab(6, 11).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Sunday And DateTime.Now.Hour = 11 Then
            CoupureInternet()
            My.Settings.DI11 = True
        Else
            RemiseInternet()
            My.Settings.DI11 = False
        End If

        If tab(6, 12).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Sunday And DateTime.Now.Hour = 12 Then
            CoupureInternet()
            My.Settings.DI12 = True
        Else
            RemiseInternet()
            My.Settings.DI12 = False
        End If

        If tab(6, 13).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Sunday And DateTime.Now.Hour = 13 Then
            CoupureInternet()
            My.Settings.DI13 = True
        Else
            RemiseInternet()
            My.Settings.DI13 = False
        End If

        If tab(6, 16).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Sunday And DateTime.Now.Hour = 16 Then
            CoupureInternet()
            My.Settings.DI16 = True
        Else
            RemiseInternet()
            My.Settings.DI16 = False
        End If

        If tab(6, 16).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Sunday And DateTime.Now.Hour = 16 Then
            CoupureInternet()
            My.Settings.DI16 = True
        Else
            RemiseInternet()
            My.Settings.DI16 = False
        End If

        If tab(6, 16).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Sunday And DateTime.Now.Hour = 16 Then
            CoupureInternet()
            My.Settings.DI16 = True
        Else
            RemiseInternet()
            My.Settings.DI16 = False
        End If

        If tab(6, 17).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Sunday And DateTime.Now.Hour = 17 Then
            CoupureInternet()
            My.Settings.DI17 = True
        Else
            RemiseInternet()
            My.Settings.DI17 = False
        End If

        If tab(6, 18).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Sunday And DateTime.Now.Hour = 18 Then
            CoupureInternet()
            My.Settings.DI18 = True
        Else
            RemiseInternet()
            My.Settings.DI18 = False
        End If

        If tab(6, 19).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Sunday And DateTime.Now.Hour = 19 Then
            CoupureInternet()
            My.Settings.DI19 = True
        Else
            RemiseInternet()
            My.Settings.DI19 = False
        End If

        If tab(6, 20).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Sunday And DateTime.Now.Hour = 20 Then
            CoupureInternet()
            My.Settings.DI20 = True
        Else
            RemiseInternet()
            My.Settings.DI20 = False
        End If

        If tab(6, 21).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Sunday And DateTime.Now.Hour = 21 Then
            CoupureInternet()
            My.Settings.DI21 = True
        Else
            RemiseInternet()
            My.Settings.DI21 = False
        End If

        If tab(6, 22).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Sunday And DateTime.Now.Hour = 22 Then
            CoupureInternet()
            My.Settings.DI22 = True
        Else
            RemiseInternet()
            My.Settings.DI22 = False
        End If

        If tab(6, 23).Checked = True And DateTime.Now.DayOfWeek = DayOfWeek.Sunday And DateTime.Now.Hour = 23 Then
            CoupureInternet()
            My.Settings.DI23 = True
        Else
            RemiseInternet()
            My.Settings.DI23 = False
        End If
        My.Settings.Save()
    End Sub

End Class
Messages postés
301
Date d'inscription
mercredi 22 septembre 2010
Dernière intervention
27 février 2018
- 9 oct. 2013 à 16:33
ahaha ! Non plus sérieusement, dès que j'ai le temps, je pense prendre ton code shay
Messages postés
3238
Date d'inscription
jeudi 26 novembre 2009
Dernière intervention
14 mars 2018
- 9 oct. 2013 à 21:19
ah enfin je pensais que j'arriverais jamais à la fin
un plus cela ne peut pas marcher
ou appelle tu la sub VerificationConnexionInternet
et aussi comment informer que tu as coché un/des checkbox
il te manque les évenements CheckBox1_Click etc
Messages postés
18039
Date d'inscription
lundi 7 décembre 2009
Statut
Contributeur
Dernière intervention
11 avril 2018
- 9 oct. 2013 à 21:25
<mode humour> Si tu tiens vraiment à rendre encore plus fastidieuse cette usine à gaz, FaonManager, il ne te reste plus qu'à ajouter un tuyau, deux durites, une pompe et un incinérateur<\mode humour>
- 19 oct. 2013 à 14:07
1 - N'oublie pas d'activer Option Strict une fois pour toutes et pour tous tes projets dans les propriétés de Visual Studio. Ca m'évitera de te le répéter à chaque nouveau sujet que tu ouvres et ça t'éviteras d'écrire des âneries du style :
Dim x
Dim y = 104


2 - Corrige ensuite les 168 redondances qui apparaissent dans ton code (bah oui 168 checkbox quand meme hin) :
 If tab(6, 20).Checked = True Then 'redondance car checked est déjà un booléen
if tab(6,20).checked then 'suffit
if not tab(6,20).checked then 'si tu veux tester l'absence de coche


3 - Shell est obsolète et doit être remplacé par Process.Start

172 erreurs corrigées ! merci qui ?
Commenter la réponse de CLeBeR_FR
Messages postés
301
Date d'inscription
mercredi 22 septembre 2010
Dernière intervention
27 février 2018
- 31 août 2014 à 22:52
0
Merci
Bonjour à tous !
Petit déterrage de sujet !
Après m'être rendu compte que le code était lourd et qu'il comportait des bugs, j'ai réussi à optimiser le code et supprimer les bugs !
Voici donc le code pour générer un tableau de textbox :

Dim tab(6, 23) As CheckBox
  Dim x As Integer
        Dim y = 104
        For jour = 0 To tab.GetLength(0) - 1
            x = 187
            For heure = 0 To tab.GetLength(1) - 1
                x = x + 30
                tab(jour, heure) = New CheckBox()
                tab(jour, heure).Left = x
                tab(jour, heure).Top = y
                tab(jour, heure).Width = 15
                Me.Controls.Add(tab(jour, heure))
            Next
            y = y + 35
        Next


Le code pour tester si une case est cochée ou non :

 Dim Collone As Integer = DateTime.Now.DayOfWeek - 1
        Dim Heure As Integer = DateTime.Now.Hour
 
        If (Now.DayOfWeek = DayOfWeek.Sunday) Then
            Collone = 6
        End If
 
        If tab(Collone, Heure).Checked And InternetDesactive = False Then
            CoupureInternet()
            InternetDesactive = True
        ElseIf tab(Collone, Heure).Checked = False And InternetDesactive = True Then
            RemiseInternet()
            InternetDesactive = False
        End If


Merci pour l'aide !
Messages postés
12240
Date d'inscription
mardi 11 mars 2003
Statut
Contributeur
Dernière intervention
15 novembre 2018
- 31 août 2014 à 23:12
Après m'être rendu compte que le code était lourd
non sans rire?
C'est pas comme si plusieurs solutions plus simples et probablement plus efficaces t'avaient été proposée....
Messages postés
301
Date d'inscription
mercredi 22 septembre 2010
Dernière intervention
27 février 2018
- 31 août 2014 à 23:26
Bonjour,
Certes des solutions ont été proposées mais je ne voyais pas un gros datagrid en plein milieu (bien que je remercie les membres de l'avoir quand même proposé).
De plus, ce n'est pas la peine d'être aussi ironique, cela frôle l'agression...
Messages postés
12240
Date d'inscription
mardi 11 mars 2003
Statut
Contributeur
Dernière intervention
15 novembre 2018
- 1 sept. 2014 à 00:21
Oui peut être, mais admets que ta phrase tend une perche énorme....
Messages postés
301
Date d'inscription
mercredi 22 septembre 2010
Dernière intervention
27 février 2018
- 1 sept. 2014 à 00:28
Je te l'accorde, bien que j'ai toujours su que le code n'était vraiment pas bon, je n'avais point d'idées pour l'optimiser. Donc il est vrai que je m'en suis rendu compte au moment même où je le tapais haha.
Enfin bref, sujet résolu !
Commenter la réponse de CLeBeR_FR

Vous n'êtes pas encore membre ?

inscrivez-vous, c'est gratuit et ça prend moins d'une minute !

Les membres obtiennent plus de réponses que les utilisateurs anonymes.

Le fait d'être membre vous permet d'avoir un suivi détaillé de vos demandes et codes sources.

Le fait d'être membre vous permet d'avoir des options supplémentaires.