[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.
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.
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
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
Re: [RESOLVED] [2008] Media Fire direct download link vb.net help
Plz tell me how to use this code