[RESOLVED] [2008] Media Fire direct download link vb.net help-VBForums
Results 1 to 5 of 5

Thread: [RESOLVED] [2008] Media Fire direct download link vb.net help

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jun 2008
    Posts
    90

    Resolved [RESOLVED] [2008] Media Fire direct download link vb.net help

    Hey guys,

    I'm not sure if anyone here uses media fire for file hosting/sharing, but I was looking for a way if it is possible to get the direct download link for my files so that it will eliminate the step for my users to need to click on a link and download the files. I want my app to goto the url where my files are, search the page for the direct url link and execute the link for them automatically, seemlessly in the background so they dont need to do anything. Is this possible?

    Thanks,
    n3m.

  2. #2
    PowerPoster stanav's Avatar
    Join Date
    Jul 2006
    Location
    Providence, RI - USA
    Posts
    9,224

    Re: [2008] Media Fire direct download link vb.net help

    I've never downloaded anything from mediafire, but if you could post a sample download link, I'll see what I can do.
    Let us have faith that right makes might, and in that faith, let us, to the end, dare to do our duty as we understand it.
    - Abraham Lincoln -

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jun 2008
    Posts
    90

    Re: [2008] Media Fire direct download link vb.net help

    Quote Originally Posted by stanav
    I've never downloaded anything from mediafire, but if you could post a sample download link, I'll see what I can do.
    An example link is:

    http://www.mediafire.com/?syzjuytmdkn

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Jun 2008
    Posts
    90

    Re: [2008] Media Fire direct download link vb.net help

    I got something working, not sure if its the best coding way of doing it but this is how I got it to work. Here's the code if anyone else wants to do something similar.

    Code:
    Imports System.Net
    Imports System.Windows.Forms
    Imports System.Security.Permissions
    Imports System.Text.RegularExpressions
    
    
    <PermissionSet(SecurityAction.Demand, Name:="FullTrust")> _
    <System.Runtime.InteropServices.ComVisibleAttribute(True)> _
    Public Class Form1
    
        Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
            WebBrowser1.ObjectForScripting = Me
            WebBrowser1.Navigate("http://www.mediafire.com/?syzjuytmdkn")
            Timer1.Enabled = True
        End Sub
    
    
    
        Public Sub LinkDownload()
            Dim linkURL As String
            Dim myMatches As MatchCollection
            Dim myRegex As New Regex("href\s*=\s*(?:""(?<1>[^""]*)""|(?<1>\S+))")
    
            linkURL = WebBrowser1.Document.GetElementById("download_link").InnerHtml
            myMatches = myRegex.Matches(linkURL)
    
            If myMatches.Count = 0 Then
                Timer1.Enabled = True
            Else
                Dim newUrl As String
                Dim fixUrl As String
    
                newUrl = myMatches(0).Value
                fixUrl = Replace(newUrl.Substring(5, newUrl.Length - 5), """", "")
                Process.Start(fixUrl)
            End If
        End Sub
    
    
        Private Sub Timer1_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles Timer1.Tick
            Timer1.Enabled = False
            Call LinkDownload()
        End Sub
    
    End Class

  5. #5
    New Member
    Join Date
    Nov 2011
    Posts
    1

    Re: [RESOLVED] [2008] Media Fire direct download link vb.net help

    Plz tell me how to use this code

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width

Survey posted by VBForums.