Files
Lecteur-media/lecteur/lecteur média/Form85.vb
T
2026-06-18 14:15:48 +02:00

106 lines
4.9 KiB
VB.net
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
Imports System.ComponentModel
Imports System.IO
Imports AxWMPLib
Public Class Form85
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim t1 = radio
Dim t2 = Form3.ComboBox6.SelectedItem
Dim t3 As String = t1 & t2 & "\flux.txt"
Dim sw1 As New StreamWriter(t3)
sw1.WriteLine(TextBox1.Text)
sw1.Close()
Dim lines1() As String = File.ReadAllLines(t3)
Form3.Label11.Text = "URL / Flux: " & lines1(0)
MsgBox("LURL / FLUX a bien été modifier", MsgBoxStyle.Information)
Close()
End Sub
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
Try
If My.Computer.Network.Ping("www.Google.com") Then
internet()
End If
Catch ex As Exception
MsgBox("Vous n’êtes actuellement pas connecté à Internet", MsgBoxStyle.Information, "Hors connexion")
End Try
End Sub
Sub internet()
If AxWindowsMediaPlayer1.playState = WMPLib.WMPPlayState.wmppsStopped Or AxWindowsMediaPlayer1.playState = WMPLib.WMPPlayState.wmppsUndefined Or AxWindowsMediaPlayer1.playState = WMPLib.WMPPlayState.wmppsReady Then
If TextBox1.Text = "" Then
MsgBox("Merci enter une URL ou un flux", MsgBoxStyle.Exclamation)
Else
Try
AxWindowsMediaPlayer1.URL = TextBox1.Text
Button2.Text = "Arrêter le teste de la radio"
Timer1.Start()
Label2.Show()
Label3.Show()
Catch ex As Exception
MsgBox("Merci entrer une URL ou un flux valide", MsgBoxStyle.Exclamation)
End Try
End If
Else
Button2.Text = "Tester la radio"
AxWindowsMediaPlayer1.Ctlcontrols.stop()
Timer1.Stop()
Label2.Hide()
Label3.Hide()
End If
End Sub
Private Sub Form85_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)
Button2.BackColor = Color.FromArgb(64, 64, 64)
Button2.ForeColor = Color.White
TextBox1.BackColor = Color.FromArgb(64, 64, 64)
TextBox1.ForeColor = Color.White
Button1.ForeColor = Color.White
Label1.ForeColor = Color.White
Label2.ForeColor = Color.White
Label3.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)
Button2.BackColor = Color.FromArgb(Form1.colorbackA, Form1.colorbackR, Form1.colorbackG, Form1.colorbackB)
Button2.ForeColor = Color.FromArgb(Form1.themeforecoloA, Form1.themeforecoloR, Form1.themeforecoloG, Form1.themeforecoloB)
TextBox1.BackColor = Color.FromArgb(Form1.colorbackA, Form1.colorbackR, Form1.colorbackG, Form1.colorbackB)
TextBox1.ForeColor = Color.FromArgb(Form1.themeforecoloA, Form1.themeforecoloR, Form1.themeforecoloG, Form1.themeforecoloB)
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)
Label3.ForeColor = Color.FromArgb(Form1.themeforecoloA, Form1.themeforecoloR, Form1.themeforecoloG, Form1.themeforecoloB)
Else
End If
AxWindowsMediaPlayer1.Hide()
Label2.Hide()
Label3.Hide()
End Sub
Private Sub AxWindowsMediaPlayer1_MediaError(sender As Object, e As _WMPOCXEvents_MediaErrorEvent) Handles AxWindowsMediaPlayer1.MediaError
MsgBox("LURL / le flux n'est pas valide ou expirés", MsgBoxStyle.Information)
AxWindowsMediaPlayer1.Ctlcontrols.stop()
Label2.Hide()
Label3.Hide()
Button2.Text = "Tester la radio"
End Sub
Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
Label2.Text = AxWindowsMediaPlayer1.status
Label3.Text = AxWindowsMediaPlayer1.Ctlcontrols.currentPositionString
End Sub
Private Sub Form85_Closing(sender As Object, e As CancelEventArgs) Handles Me.Closing
TextBox1.Clear()
Label2.Hide()
Label3.Hide()
AxWindowsMediaPlayer1.Ctlcontrols.stop()
Button2.Text = "Tester la radio"
End Sub
End Class