ohhh sorry... I did not mentioned something..

textbox3.text = "http://torcache.net/torrent/55282A6D8AA608CAED27B0250605AAE6E0EE2F4F.torrent"

and i also tried

Dim boundary As String = "---------------------------" & String.Concat(Enumerable.Range(0, 13).Select(Function(x) rnd.Next(3, 9).ToString()))

And also tried with this

Dim boundary As String = "---------------------------" & DateTime.Now.Ticks.ToString("x")

but no progress...
Firstly i can login successfully but unable to upload torrent file from remote url.....
textbox3.text contains my remote torrent file url


i made a request file as below where ccont is my generated login cookiecontainer:

Static rnd As New Random()
        Dim boundary As String = String.Concat(Enumerable.Range(0, 13).Select(Function(x) rnd.Next(3, 9).ToString()))
        'Dim boundary As String = "---------------------------" & DateTime.Now.Ticks.ToString("x")
        Dim req As HttpWebRequest = DirectCast(WebRequest.Create("http://www.bytebx.com/storage"), HttpWebRequest)
        req.Method = "POST"
        req.CookieContainer = ccont
        req.KeepAlive = True
        req.Referer = "http://www.bytebx.com/storage"
        req.UserAgent = "Mozilla/5.0 (Windows NT 6.3; rv:29.0) Gecko/20100101 Firefox/29.0"
        req.ContentType = "multipart/form-data; boundary=" & "---------------------------" & DateTime.Now.Ticks.ToString("x")
        Dim builder As New StringBuilder()
        builder.Append(boundary & vbNewLine & "Content-Disposition: form-data; name=""url""" & vbNewLine & vbNewLine)
        builder.Append(TextBox3.Text & vbCrLf)
        builder.Append(boundary & vbCrLf & "Content-Disposition: form-data; name=""file""; filename=""""" & vbCrLf)
        builder.Append("Content-Type: application/octet-stream")
        ' Footer Bytes
        Dim close As Byte() = Encoding.UTF8.GetBytes("--")
        Dim postHeader As String = builder.ToString()
        'TextBox4.Text = postHeader
        Dim postHeaderBytes As Byte() = Encoding.UTF8.GetBytes(postHeader)
        Dim boundaryBytes As Byte() = Encoding.ASCII.GetBytes(vbCrLf & boundary & "--" & vbCrLf)
        Dim length As Long = postHeaderBytes.Length + boundaryBytes.Length
        req.ContentLength = length
        Dim requestStream As Stream = req.GetRequestStream()
        Dim fulllength As Integer = postHeaderBytes.Length + boundaryBytes.Length
        ' Write out our post header
        requestStream.Write(postHeaderBytes, 0, postHeaderBytes.Length)
        ' Write out the trailing boundary
        requestStream.Write(boundaryBytes, 0, boundaryBytes.Length)
        Dim responce As WebResponse
        responce = req.GetResponse()
        Dim s As Stream = responce.GetResponseStream()
        Dim sr As New StreamReader(s)
        Dim Content As String = sr.ReadToEnd()


I want to make a form application that upload torrent file in bytebx.com using my username and password

Could any one help me?

Torrent uploading header request like :


POST /storage HTTP/1.1
Host: bytebx.com
User-Agent: Mozilla/5.0 (Windows NT 6.3; rv:34.0) Gecko/20100101 Firefox/34.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Referer: http://bytebx.com/storage
Cookie: xxxxxxx
Connection: keep-alive
Content-Type: multipart/form-data; boundary=---------------------------1461596626053
Content-Length: 444
Content-Disposition: form-data; name="url"

Content-Disposition: form-data; name="file"; filename=""
Content-Type: application/octet-stream



Get the image source of the below link which pass the condition itemprop="image" and id="poster_image"

<img itemprop="image" id="poster_image" style="width: 300px; height: 442px; " alt="" title="" src="*This is the source.jpg*" />


after editing as you said (Begginnerdev) when i am clicking button 1 then the application hangs, cursor turned into busy mood and hangs me a lot of time. then i closed the apps.
I tried a lot but every time getting this.
please do something.....


hey Begginnerdev: Thanks for your help. But sorry to say, some problem in your code...

I added :

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Call GetAllLinks()
    End Sub

but it gave me an error in "sDocument".

Will you tell me the full code starting like:

Public Class Form1
End Class

after adding your code, my code is as below:

Imports System.Text.RegularExpressions

Public Class Form1

    Private CurrentCollection As HtmlElementCollection

    Private Sub Populate(ByVal sAddress As String)
        sAddress = "http://google.com"
        Dim linkCollection As HtmlElementCollection = GetAllLinks(sAddress)

        For i = 0 To linkCollection.Count - 1

        'Keep track of current links
        CurrentCollection = linkCollection
    End Sub

    Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs) Handles ComboBox1.SelectedIndexChanged
            If ComboBox1.SelectedValue < CurrentCollection.Count - 1 Then
                'Fill the Text Box
                TextBox1.Text = CurrentCollection.Item(CInt(ComboBox1.SelectedValue)).OuterText
            End If
        Catch ex As Exception
        End Try
    End Sub

    Private Function GetAllLinks(ByVal sDocument As String) As HtmlElementCollection
            Dim bLoad As New WebBrowser()

            While bLoad.ReadyState <> WebBrowserReadyState.Complete
                'Loop till loaded.
            End While

            Dim htmlDoc As HtmlDocument = bLoad.Document

            'Return the Collection
            Return htmlDoc.Links
        Catch ex As Exception
            Return Nothing
        End Try
    End Function

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Call GetAllLinks()
    End Sub
End Class

Please upload a full sourcecode as attachment. i am using Visual basic 2010


Please help me.... See the code below.

Imports System.Text.RegularExpressions
Public Class Form1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim request As System.Net.HttpWebRequest = System.Net.HttpWebRequest.Create("**HERE IS MY DESIRED URL**")
        Dim response As System.Net.HttpWebResponse = request.GetResponse

        Dim sr As System.IO.StreamReader = New System.IO.StreamReader(response.GetResponseStream())

        Dim rssourcecode As String = sr.ReadToEnd

        Dim r As New System.Text.RegularExpressions.Regex("<a class=""category"" href=""**HERE IS THE URL**"">**HERE SOME TEXt**</a><br /> ")
        Dim matches As MatchCollection = r.Matches(rssourcecode)
        For Each itemcode As Match In matches

    End Sub
End Class

I want to get data "HERE SOME TEXt" list in a combobox and respective "HERE IS THE URL" link in a textbox.

see as example 1
see as example 2

remember : in source code there have a lot of links. i want the link exack match as

<a class="category" href="link">name</a><br />

please help me....


sir i want to get data between to tag...
example:(showing in my view source)

<img class='stat_icon' src='/images/green.png'> 
**data to be extracted**</a>

or like

<input type=hidden name=timestamp value='**data to be extracted**'>

for the first example i wrote like:

Imports System.Text.RegularExpressions
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim requestt As System.Net.HttpWebRequest = System.Net.HttpWebRequest.Create("my desired link")
            Dim responsee As System.Net.HttpWebResponse = requestt.GetResponse()
            Dim sr As System.IO.StreamReader = New System.IO.StreamReader(responsee.GetResponseStream())
            Dim sourcecodee As String = sr.ReadToEnd()
            Dim pattern1 As String = "<img class='stat_icon' src='/images/red.png'> " & _
            Dim m As Match = Regex.Match(sourcecodee, pattern1)
            If m.Success Then
            End If
End Sub

but nothing showing or appearning as msgbox.

please solve it and discus it with example as much as u can.