Probleme dans ma sourcecode help

Résolu
jeremy93410 - 5 mai 2013 à 00:28
 Utilisateur anonyme - 5 mai 2013 à 20:00
Voila c'est pour mon bot youtube , vous trouvez un erreur , ou une ligne manquante ?

Imports System.Net
Public Class F_Main
Dim TRead As New Threading.Thread(AddressOf OFD)
Dim TBoost As New Threading.Thread(AddressOf StartView)
Dim TBoost2 As New Threading.Thread(AddressOf StartView)
Dim TBoost3 As New Threading.Thread(AddressOf StartView)
Dim Prxyz As List(Of String) = New List(Of String)
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
TRead.IsBackground = True
TRead.TrySetApartmentState(Threading.ApartmentState.STA)
TRead.Start()
UpdateLog(DateTime.Now + ": Threads created...")
End Sub
Private Sub OFD()
Using ofd As New OpenFileDialog
If ofd.ShowDialog = Windows.Forms.DialogResult.OK Then
UpdateLog(DateTime.Now + ": Proxies loaded...")
Prxyz.AddRange(IO.File.ReadAllLines(ofd.FileName))
For Each Proxy As [String] In Prxyz
Add(Proxy)
Next
End If
End Using
End Sub
Sub UpdateLog(ByVal Item As [String])
If Me.ListBox2.InvokeRequired Then
Me.Invoke(DirectCast(Sub() ListBox2.Items.Add(Item), MethodInvoker))
Else
ListBox2.Items.Add(Item)
End If
End Sub
Sub Add(ByVal Item As [String])
If Me.ListBox1.InvokeRequired Then
Me.Invoke(DirectCast(Sub() ListBox1.Items.Add(Item), MethodInvoker))
Else
ListBox1.Items.Add(Item)
End If
End Sub
Sub AddViewCount(ByVal i As Int32)
If Label3.InvokeRequired Then
Me.Invoke(DirectCast(Sub() Label2.Text = "Views Added: " & CInt(Label2.Text.Split(":")(1)) + 1, MethodInvoker))
Else
Label2.Text = "Views Added: " & CInt(Label2.Text.Split(":")(1)) + 1
End If
End Sub
Private Sub View(ByVal URL As [String], prx As String, ByVal Views As Int32)
Try
UpdateLog(DateTime.Now + ": Viewing video...")
Dim logincookie As New CookieContainer
Dim postData As String = "referer=" + UserReferer()
Dim tempCookies As New CookieContainer
Dim encoding As New System.Text.UTF8Encoding
Dim byteData As Byte() = encoding.GetBytes(postData)
Dim postReq As HttpWebRequest = DirectCast(WebRequest.Create(TextBox1.Text), HttpWebRequest)
postReq.Proxy = New WebProxy(prx)
postReq.Method = "POST"
postReq.CookieContainer = tempCookies
postReq.ContentType = "application/x-www-form-urlencoded"
postReq.Referer = UserReferer()
postReq.UserAgent = UserAgent()
postReq.ContentLength = byteData.Length
Dim postreqstream As IO.Stream = postReq.GetRequestStream()
postreqstream.Write(byteData, 0, byteData.Length)
postreqstream.Close()
Dim postresponse As HttpWebResponse
postresponse = DirectCast(postReq.GetResponse(), HttpWebResponse)
tempCookies.Add(postresponse.Cookies)
logincookie = tempCookies
UpdateLog(DateTime.Now + ": Successfully added view...")
Catch ex As Exception
UpdateLog(DateTime.Now + ": DEAD PROXY!")
End Try
UpdateLog(DateTime.Now + Void())
End Sub
Private Shared Random As New Random
Private Function Void() As [String]
Dim ar As String() = {": DEAD PROXY!", "Successfully added view..."}
Return ar(Random.Next(0, ar.Length - 1))
End Function
Private Function UserReferer() As [String]
UpdateLog(DateTime.Now + ": Requesting Referer...")
Static Referer As [String]() = _
{"http://facebook.com",
"http://twitter.com/"}
Return Referer(Random.Next(0, Referer.Length - 1))
End Function
Private Function UserAgent() As [String]
UpdateLog(DateTime.Now + ": Requesting Agents...")
Static Agents As [String]() = _
{"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_2) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1309.0 Safari/537.17",
"Mozilla/5.0 (Windows NT 6.2) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.26 Safari/537.11",
"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/535.21 (KHTML, like Gecko) Chrome/19.0.1042.0 Safari/535.21",
"Mozilla/6.0 (Windows NT 6.2; WOW64; rv:16.0.1) Gecko/20121011 Firefox/16.0.1",
"Mozilla/5.0 (Macintosh; I; Intel Mac OS X 11_7_9; de-LI; rv:1.9b4) Gecko/2012010317 Firefox/10.0a4",
"mozilla/3.0 (Windows NT 6.1; rv:2.0.1) Gecko/20100101 Firefox/5.0.1",
"Opera/9.80 (Windows NT 6.1; U; es-ES) Presto/2.9.181 Version/12.00",
"Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.13) Gecko/20101213 Opera/9.80 (Windows NT 6.1; U; zh-tw) Presto/2.7.62 Version/11.01"}
Return Agents(Random.Next(0, Agents.Length - 1))
End Function

Dim Count As Int32 = 0
Dim url$ = ""
Private Sub StartView()
UpdateLog(DateTime.Now + ": Starting views...")
For i As Int32 = 0 To Count Step 1
View(url, Prxyz(i), 1)
AddViewCount(1)
Next
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
UpdateLog(DateTime.Now + ": Initialized bot...")
Count = ListBox1.Items.Count
Button1.Enabled = False
url = TextBox1.Text
TBoost.IsBackground = True
TBoost.TrySetApartmentState(Threading.ApartmentState.STA)
TBoost.Start()
TBoost2.IsBackground = True
TBoost2.TrySetApartmentState(Threading.ApartmentState.STA)
TBoost2.Start()
TBoost3.IsBackground = True
TBoost3.TrySetApartmentState(Threading.ApartmentState.STA)
TBoost3.Start()
End Sub

Private Sub F_Main_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

End Sub
End Class


Merci de votre aide

2 réponses

Utilisateur anonyme
5 mai 2013 à 02:01
Au diable le bonjour et la politesse,

Merci de votre aide


Aide-toi et le Ciel t'aidera donc

1) Indente ton code pour qu'il soit lisible
2) Utilise les balise de formatage (Clique sur la bonne icône dans la liste déroulante de la 3e icône à partir de la droite de cette fenêtre
3) Fais l'effort élémentaire de nous dire ce qui ne marche pas et quelle(s) ligne(s) donne(nt) une des erreurs
4) Quel est (sont) le(s) message(s) d'erreur(s) obtenu(s)
5) Lis le règlement et veille à t'y conformer si tu veux avoir un réponse différente de celle-ci.
3
Utilisateur anonyme
5 mai 2013 à 20:00
Heureusement que cmarcotte à donné la bonne réponse car moi je séchais...



Cordialement


CF2i - Guadeloupe
Ingénierie Informatique
0
Rejoignez-nous