158 lines
6.6 KiB
VB.net
158 lines
6.6 KiB
VB.net
Imports System.IO
|
|
Imports System.Net
|
|
Imports System.Net.Mail
|
|
Imports System.Threading
|
|
Imports System.Windows.Forms.VisualStyles.VisualStyleElement
|
|
|
|
Public Class Form36
|
|
Dim caté As String = ""
|
|
|
|
Private Sub ComboBox1_SelectedValueChanged(sender As Object, e As EventArgs) Handles ComboBox1.SelectedValueChanged
|
|
If ComboBox1.SelectedItem = "Autre" Then
|
|
Label2.Text = "explication: (obligatoire)"
|
|
Else
|
|
Label2.Text = "explication: (facutatif)"
|
|
End If
|
|
End Sub
|
|
|
|
Private Sub Form36_Load(sender As Object, e As EventArgs) Handles MyBase.Load
|
|
Text = "signaler: " & Form32.Text
|
|
ComboBox1.SelectedItem = "Contenu a caractère sexuel"
|
|
End Sub
|
|
|
|
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
|
|
If ComboBox1.SelectedItem = "Autre" Then
|
|
If TextBox1.Text = "" Or TextBox1.Text = " " Or TextBox1.Text = " " Then
|
|
MsgBox("merci d'expliquer vôtre signalement", MsgBoxStyle.Exclamation)
|
|
Else
|
|
mail()
|
|
End If
|
|
Else
|
|
mail()
|
|
End If
|
|
End Sub
|
|
Sub mail()
|
|
|
|
Dim Message As String = "L'utilisateur: " & nomutilisateur & vbNewLine & vbNewLine & "contenue signaler: " & Form32.Text & vbNewLine & vbNewLine & "catégorie: " & ComboBox1.SelectedItem & vbNewLine & vbNewLine & "Expliquation: " & TextBox1.Text & vbNewLine & vbNewLine & "chemaint sur le serveur: " & Form32.urldl
|
|
|
|
Dim MyMailMessage As New MailMessage()
|
|
Dim SMTPServer As New SmtpClient("mail51.lwspanel.com")
|
|
|
|
MyMailMessage.From = New MailAddress("noreply@extreme-downloaders.fr")
|
|
MyMailMessage.To.Add("contact@extreme-downloaders.fr")
|
|
MyMailMessage.To.Add("yoannmultigamig@gmail.com")
|
|
MyMailMessage.To.Add("adamnoah1511@yahoo.com")
|
|
|
|
MyMailMessage.Subject = ("signalement")
|
|
MyMailMessage.Body = (Message)
|
|
|
|
SMTPServer.Port = ("587") 'Port
|
|
SMTPServer.Credentials = New System.Net.NetworkCredential("noreply@extreme-downloaders.fr", "yR9$sGrjZDwDMdA")
|
|
SMTPServer.EnableSsl = True
|
|
|
|
SMTPServer.Send(MyMailMessage) 'Envoi
|
|
|
|
addqqignalement()
|
|
MsgBox("Le signalement a bien été envoyé", MsgBoxStyle.Information)
|
|
Close()
|
|
End Sub
|
|
Sub addqqignalement()
|
|
If Form32.urldl.Contains("logiciels") Then
|
|
caté = "logiciels"
|
|
ElseIf Form32.urldl.Contains("ISO/Autre") Then
|
|
caté = "ISO - Autre"
|
|
ElseIf Form32.urldl.Contains("Autre") Then
|
|
caté = "Autre"
|
|
ElseIf Form32.urldl.Contains("Tout les jeux") Then
|
|
caté = "Tout les jeux"
|
|
ElseIf Form32.urldl.Contains("Maps") Then
|
|
caté = "Minecraft - Maps - " & Form28.ComboBox6.SelectedItem
|
|
ElseIf Form32.urldl.Contains("Launchers") Then
|
|
caté = "Minecraft - Launchers"
|
|
ElseIf Form32.urldl.Contains("Mods") Then
|
|
caté = "Minecraft - Mods - " & Form28.ComboBox4.SelectedItem
|
|
ElseIf Form32.urldl.Contains("pack de texture") Then
|
|
caté = "Minecraft - pack de texture - " & Form28.ComboBox1.SelectedItem
|
|
ElseIf Form32.urldl.Contains("Plugins") Then
|
|
caté = "Minecraft - Plugins - " & Form28.ComboBox5.SelectedItem
|
|
ElseIf Form32.urldl.Contains("serveur préfaits") Then
|
|
caté = "Minecraft - serveur préfaits - " & Form28.ComboBox7.SelectedItem
|
|
ElseIf Form32.urldl.Contains("shaders") Then
|
|
caté = "Minecraft - shaders - " & Form28.ComboBox8.SelectedItem
|
|
ElseIf Form32.urldl.Contains("Linux") Then
|
|
caté = "ISO - Linux"
|
|
ElseIf Form32.urldl.Contains("Windows") Then
|
|
caté = "ISO - Windows"
|
|
End If
|
|
Try
|
|
ListBox1.Items.Clear()
|
|
Dim fwr As FtpWebRequest
|
|
fwr = FtpWebRequest.Create(ipserver & "signalement/")
|
|
fwr.Credentials = New NetworkCredential("extremedownloaders", passftp)
|
|
fwr.Method = WebRequestMethods.Ftp.ListDirectory
|
|
Dim sr As New StreamReader(fwr.GetResponse().GetResponseStream())
|
|
|
|
Dim str As String = sr.ReadLine()
|
|
While Not str Is Nothing
|
|
|
|
Directory.CreateDirectory(dostemps & str)
|
|
|
|
|
|
str = sr.ReadLine()
|
|
End While
|
|
sr.Close()
|
|
|
|
If Directory.Exists(dostemps & "/" & Form32.Text & " - " & caté) = True Then
|
|
For Each fichier As String In IO.Directory.GetDirectories(dostemps)
|
|
Dim info As New IO.FileInfo(fichier)
|
|
Directory.Delete(dostemps & info.Name)
|
|
Next
|
|
addsignalement2()
|
|
Else
|
|
For Each fichier As String In IO.Directory.GetDirectories(dostemps)
|
|
Dim info As New IO.FileInfo(fichier)
|
|
Directory.Delete(dostemps & info.Name)
|
|
Next
|
|
creatdos()
|
|
End If
|
|
|
|
Catch ex As Exception
|
|
|
|
End Try
|
|
End Sub
|
|
Sub creatdos()
|
|
Try
|
|
Dim MaRequete As System.Net.FtpWebRequest = DirectCast(System.Net.WebRequest.Create(ipserver & "signalement/" & Form32.Text & " - " & caté), System.Net.FtpWebRequest)
|
|
Dim ftpStream As Stream = Nothing
|
|
|
|
MaRequete.Credentials = New System.Net.NetworkCredential("extremedownloaders", passftp)
|
|
MaRequete.Method = System.Net.WebRequestMethods.Ftp.MakeDirectory
|
|
|
|
Dim response As FtpWebResponse = CType(MaRequete.GetResponse, FtpWebResponse)
|
|
ftpStream = response.GetResponseStream
|
|
ftpStream.Close()
|
|
response.Close()
|
|
|
|
Dim sw1 As New StreamWriter(dostemps & "signalement.txt")
|
|
sw1.WriteLine(1)
|
|
sw1.Close()
|
|
|
|
My.Computer.Network.UploadFile(dostemps & "signalement.txt", ipserver & "signalement/" & Form32.Text & " - " & caté & "/signalement.txt")
|
|
File.Delete(dostemps & "signalement.txt")
|
|
|
|
Catch ex As Exception
|
|
|
|
End Try
|
|
End Sub
|
|
Sub addsignalement2()
|
|
My.Computer.Network.DownloadFile(ipsite & "extrème downloaders/signalement/" & Form32.Text & " - " & caté & "/signalement.txt", dostemps & "/signalement.txt")
|
|
Dim lines1() As String = File.ReadAllLines(dostemps & "signalement.txt")
|
|
Dim nsing = lines1(0) + 1
|
|
File.Delete(dostemps & "/signalement.txt")
|
|
Dim sw1 As New StreamWriter(dostemps & "/signalement.txt")
|
|
sw1.WriteLine(nsing)
|
|
sw1.Close()
|
|
My.Computer.Network.UploadFile(dostemps & "/signalement.txt", ipserver & "/signalement/" & Form32.Text & " - " & caté & "/signalement.txt")
|
|
File.Delete(dostemps & "/signalement.txt")
|
|
End Sub
|
|
End Class |