Page 1 of 4

Create Custom Download Manager for VB Webbrowser?!

Posted: Fri Feb 11, 2011 1:00 am
by Napster1488
Hey Guys ,
i have a Question i just maked a Webbrowser with the Webbrowser that is included with Visual Basic..
And i wonna have a New Custom Download Manager ,so when i click on any File that can be Downloadet then that Downloader opens and automaticilly downloads the File...
i saw the "FileDownload" Event from the WebBrowser but i really dont know how i could code this ..
Can someone help ?!

Re: Create Custom Download Manager for VB Webbrowser?!

Posted: Fri Feb 11, 2011 1:19 am
by mandai
The easiest way would be to use the Navigating event in the webbrowser, then you can check to see if e.Url matches a format for a file that you would like use in your downloader. You can then set e.Cancel to True and download the file from your own code.

Re: Create Custom Download Manager for VB Webbrowser?!

Posted: Fri Feb 11, 2011 1:27 am
by Proprogrammer
Very well done mandai, i wouldnt put better myself. After you do that all you need to do is make another form for downloading files and use a piece that finds the downloadable file. then puts it into a textbox, after that, it downloads the file that is set into the textbox.

Re: Create Custom Download Manager for VB Webbrowser?!

Posted: Fri Feb 11, 2011 3:26 am
by Usman55
Napster1488 wrote:
Hey Guys ,
i have a Question i just maked a Webbrowser with the Webbrowser that is included with Visual Basic..
And i wonna have a New Custom Download Manager ,so when i click on any File that can be Downloadet then that Downloader opens and automaticilly downloads the File...
i saw the "FileDownload" Event from the WebBrowser but i really dont know how i could code this ..
Can someone help ?!
I think you can use the FileDownload event better than the Navigating. Just put e.cancel=true and enter your downloader code to it. In my case I used FormDownload.Textbox1.Text = FormMain.WebBrowser1.URL I haven't tested it cuz I didn't have a file to download lol. But try to tweak it a bit if it doesn't works. And if you want to download the file using Navigating event, then maybe the code will be like this: If WebBrowser1.URL.EndsWith ".exe" Then I haven't tried that either and maybe there is an equation symbol between the code but I am not sure.

Re: Create Custom Download Manager for VB Webbrowser?!

Posted: Fri Feb 11, 2011 10:09 am
by Napster1488
very much thanks guys...i will try :)

Re: Create Custom Download Manager for VB Webbrowser?!

Posted: Fri Feb 11, 2011 10:30 am
by Usman55
Please do and tell me how it worked cuz I haven't checked it myself.

Re: Create Custom Download Manager for VB Webbrowser?!

Posted: Fri Feb 11, 2011 10:46 am
by Napster1488
Usman55 wrote:
Please do and tell me how it worked cuz I haven't checked it myself.
Ok
ohh before i forgott i just Created a YouTube Video Downloader with that u can Download YouTube Videos in different Quality...its working with the new YouTube Code.I will upload it in next Days here ;)

Re: Create Custom Download Manager for VB Webbrowser?!

Posted: Fri Feb 11, 2011 2:34 pm
by mandai
I think you can use the FileDownload event
This isn't the same event that occurs when the file download dialog appears, also e is not a useful parameter in this event.

Re: Create Custom Download Manager for VB Webbrowser?!

Posted: Fri Feb 11, 2011 6:56 pm
by Napster1488
mandai wrote:
I think you can use the FileDownload event
This isn't the same event that occurs when the file download dialog appears, also e is not a useful paramater in this event.
soo then what i should do ?
i havent tested it yet since i am not on my pc...

Re: Create Custom Download Manager for VB Webbrowser?!

Posted: Fri Feb 11, 2011 7:44 pm
by mandai
You should go with the first suggestion.