Files
2026-06-18 14:15:48 +02:00

128 lines
5.4 KiB
VB.net

Imports System.ComponentModel
Imports System.IO
Imports System.Net
Public Class Form33
Public optas As Integer = 0
Private Sub Form33_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Dim lines2() As String = File.ReadAllLines(théme)
If lines2(0) = 2 Then
Me.BackColor = Color.FromArgb(64, 64, 64)
Me.ForeColor = Color.White
ListBox1.BackColor = Color.FromArgb(64, 64, 64)
ListBox2.BackColor = Color.FromArgb(64, 64, 64)
Button1.BackColor = Color.FromArgb(64, 64, 64)
Button2.BackColor = Color.FromArgb(64, 64, 64)
ListBox1.ForeColor = Color.White
ListBox2.ForeColor = Color.White
ElseIf lines2(0) = 3 Then
Me.BackColor = Color.FromArgb(Form1.colorbackA, Form1.colorbackR, Form1.colorbackG, Form1.colorbackB)
Me.ForeColor = Color.FromArgb(Form1.themeforecoloA, Form1.themeforecoloR, Form1.themeforecoloG, Form1.themeforecoloB)
ListBox1.BackColor = Color.FromArgb(Form1.colorbackA, Form1.colorbackR, Form1.colorbackG, Form1.colorbackB)
ListBox2.BackColor = Color.FromArgb(Form1.colorbackA, Form1.colorbackR, Form1.colorbackG, Form1.colorbackB)
Button1.BackColor = Color.FromArgb(Form1.colorbackA, Form1.colorbackR, Form1.colorbackG, Form1.colorbackB)
Button2.BackColor = Color.FromArgb(Form1.colorbackA, Form1.colorbackR, Form1.colorbackG, Form1.colorbackB)
ListBox1.ForeColor = Color.FromArgb(Form1.themeforecoloA, Form1.themeforecoloR, Form1.themeforecoloG, Form1.themeforecoloB)
ListBox2.ForeColor = Color.FromArgb(Form1.themeforecoloA, Form1.themeforecoloR, Form1.themeforecoloG, Form1.themeforecoloB)
End If
If optas = 0 Then
Label1.Text = "Film autorisé"
Label2.Text = "Film bloquer"
Dim fwr5 As FtpWebRequest
fwr5 = FtpWebRequest.Create(ipserver & "/film/find/")
fwr5.Credentials = New NetworkCredential("yoannsafe", passftp)
fwr5.Method = WebRequestMethods.Ftp.ListDirectory
Dim sr1 As New StreamReader(fwr5.GetResponse().GetResponseStream())
Dim str1 As String = sr1.ReadLine()
While Not str1 Is Nothing
Dim azaz = str1.Replace(".txt", "")
ListBox1.Items.Add(azaz)
str1 = sr1.ReadLine()
End While
sr1.Close()
For Each fichier As String In IO.Directory.GetFiles(doscontroleparantal & "\film\")
Dim info As New IO.FileInfo(fichier)
Dim azaz = info.Name.Replace(".txt", "")
ListBox2.Items.Add(azaz)
ListBox1.Items.Remove(azaz)
Next
Else
Dim fwr5 As FtpWebRequest
fwr5 = FtpWebRequest.Create(ipserver & "/Série/find/")
fwr5.Credentials = New NetworkCredential("yoannsafe", passftp)
fwr5.Method = WebRequestMethods.Ftp.ListDirectory
Dim sr1 As New StreamReader(fwr5.GetResponse().GetResponseStream())
Dim str1 As String = sr1.ReadLine()
While Not str1 Is Nothing
Dim azaz = str1.Replace(".txt", "")
ListBox1.Items.Add(azaz)
str1 = sr1.ReadLine()
End While
sr1.Close()
For Each fichier As String In IO.Directory.GetFiles(doscontroleparantal & "\Séries\")
Dim info As New IO.FileInfo(fichier)
Dim azaz = info.Name.Replace(".txt", "")
ListBox2.Items.Add(azaz)
ListBox1.Items.Remove(azaz)
Next
Label1.Text = "Série autorisé"
Label2.Text = "Série bloquer"
End If
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
If ListBox1.SelectedItem = "" Then
Else
If optas = 0 Then
ListBox2.Items.Add(ListBox1.SelectedItem)
Dim sw1 As New StreamWriter(doscontroleparantal & "\film\" & ListBox1.SelectedItem.ToString & ".txt")
sw1.WriteLine(0)
sw1.Close()
ListBox1.Items.Remove(ListBox1.SelectedItem)
Else
ListBox2.Items.Add(ListBox1.SelectedItem)
Dim sw1 As New StreamWriter(doscontroleparantal & "\Séries\" & ListBox1.SelectedItem.ToString & ".txt")
sw1.WriteLine(0)
sw1.Close()
ListBox1.Items.Remove(ListBox1.SelectedItem)
End If
End If
End Sub
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
If ListBox2.SelectedItem = "" Then
Else
If optas = 0 Then
ListBox1.Items.Add(ListBox2.SelectedItem)
File.Delete(doscontroleparantal & "\film\" & ListBox2.SelectedItem.ToString & ".txt")
ListBox2.Items.Remove(ListBox2.SelectedItem)
Else
ListBox1.Items.Add(ListBox2.SelectedItem)
File.Delete(doscontroleparantal & "\Séries\" & ListBox2.SelectedItem.ToString & ".txt")
ListBox2.Items.Remove(ListBox2.SelectedItem)
End If
End If
End Sub
Private Sub Form33_Closing(sender As Object, e As CancelEventArgs) Handles Me.Closing
ListBox2.Items.Clear()
ListBox1.Items.Clear()
End Sub
End Class