Imports System.ComponentModel Imports System.IO Imports AxWMPLib Public Class Form74 Dim min As Integer = 120 Public startserie As Integer = 0 Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click Timer1.Stop() Timer3.Stop() Timer2.Stop() Timer4.Stop() min = 120 Close() End Sub Private Sub Form74_Load(sender As Object, e As EventArgs) Handles MyBase.Load Dim lines1a() As String = File.ReadAllLines(théme) If lines1a(0) = 2 Then Me.BackColor = Color.FromArgb(64, 64, 64) Button1.BackColor = Color.FromArgb(64, 64, 64) Button1.ForeColor = Color.White Label1.ForeColor = Color.White Label2.ForeColor = Color.White Button2.BackColor = Color.FromArgb(64, 64, 64) Button2.ForeColor = Color.White ElseIf lines1a(0) = 3 Then Me.BackColor = Color.FromArgb(Form1.colorbackA, Form1.colorbackR, Form1.colorbackG, Form1.colorbackB) Button1.BackColor = Color.FromArgb(Form1.colorbackA, Form1.colorbackR, Form1.colorbackG, Form1.colorbackB) Button1.ForeColor = Color.FromArgb(Form1.themeforecoloA, Form1.themeforecoloR, Form1.themeforecoloG, Form1.themeforecoloB) Label1.ForeColor = Color.FromArgb(Form1.themeforecoloA, Form1.themeforecoloR, Form1.themeforecoloG, Form1.themeforecoloB) Label2.ForeColor = Color.FromArgb(Form1.themeforecoloA, Form1.themeforecoloR, Form1.themeforecoloG, Form1.themeforecoloB) Button2.BackColor = Color.FromArgb(Form1.colorbackA, Form1.colorbackR, Form1.colorbackG, Form1.colorbackB) Button2.ForeColor = Color.FromArgb(Form1.themeforecoloA, Form1.themeforecoloR, Form1.themeforecoloG, Form1.themeforecoloB) Else End If If startserie = 1 Then Dim lines1() As String = File.ReadAllLines(Form1.settingseries) If lines1(0) = 3 Then Label1.Text = "Votre session va se fermer dans:" Label2.Text = min Timer1.Start() ElseIf lines1(0) = 5 Then Label1.Text = "Votre ordinateur vas s'arrêté dans:" Label2.Text = min Timer2.Start() ElseIf lines1(0) = 2 Then Label1.Text = "Votre session va se verrouiller dans:" Label2.Text = min Timer3.Start() ElseIf lines1(0) = 4 Then Label1.Text = "vôtre ordinateur vas se méttre en veille prolongé dans" Label2.Text = min Timer4.Start() End If Else Dim lines1() As String = File.ReadAllLines(settings5) If lines1(0) = 1 Then Label1.Text = "Votre session va se fermer dans:" Label2.Text = min Timer1.Start() ElseIf lines1(0) = 3 Then Label1.Text = "Votre ordinateur vas s'arrêté dans:" Label2.Text = min Timer2.Start() ElseIf lines1(0) = 2 Then Label1.Text = "Votre session va se verrouiller dans:" Label2.Text = min Timer3.Start() ElseIf lines1(0) = 4 Then Label1.Text = "vôtre ordinateur vas se méttre en veille prolongé dans" Label2.Text = min Timer4.Start() End If End If End Sub Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick If Label2.Text = 0 Then Timer1.Stop() Shell("shutdown -l") min = 120 Else min -= 1 Label2.Text = min End If End Sub Private Sub Timer2_Tick(sender As Object, e As EventArgs) Handles Timer2.Tick If Label2.Text = 0 Then Timer2.Stop() Shell("shutdown -p") min = 120 Else min -= 1 Label2.Text = min End If End Sub Private Sub Timer3_Tick(sender As Object, e As EventArgs) Handles Timer3.Tick If Label2.Text = 0 Then Shell("rundll32.exe user32.dll,LockWorkStation") min = 120 Timer3.Stop() Close() Else min -= 1 Label2.Text = min End If End Sub Private Sub Timer4_Tick(sender As Object, e As EventArgs) Handles Timer4.Tick If Label2.Text = 0 Then Timer4.Stop() min = 120 Shell("rundll32.exe powrprof.dll,SetSuspendState 1,1,0") Else min -= 1 Label2.Text = min End If End Sub Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click Dim lines3() As String = File.ReadAllLines(settings5) If lines3(0) = 1 Then Timer1.Stop() Shell("shutdown -l") min = 120 Close() ElseIf lines3(0) = 2 Then Timer3.Stop() Shell("rundll32.exe user32.dll,LockWorkStation") min = 120 Close() ElseIf lines3(0) = 3 Then Timer2.Stop() Shell("shutdown -p") min = 120 Close() ElseIf lines3(0) = 4 Then Timer4.Stop() Shell("rundll32.exe powrprof.dll,SetSuspendState 1,1,0") min = 120 Close() End If End Sub Private Sub Form74_Closing(sender As Object, e As CancelEventArgs) Handles Me.Closing startserie = 0 End Sub Private Sub Form74_KeyDown(sender As Object, e As KeyEventArgs) Handles MyBase.KeyDown If e.KeyData = Keys.Escape Then Timer1.Stop() Timer2.Stop() Timer3.Stop() Timer4.Stop() min = 120 Close() End If End Sub End Class