-
Feb 5th, 2009, 04:37 PM
#1
Thread Starter
Lively Member
[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.
-
Feb 5th, 2009, 04:50 PM
#2
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 -
-
Feb 5th, 2009, 05:15 PM
#3
Thread Starter
Lively Member
Re: [2008] Media Fire direct download link vb.net help
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
-
Feb 5th, 2009, 05:52 PM
#4
Thread Starter
Lively Member
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
-
Nov 11th, 2011, 05:19 AM
#5
New Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|