on my project theres a webbrowser,and my custom html load on webbrowser when form load.
in my custom html there a download links of a file ex:
<a href="http://localhost/fie1.exe">file1.exe</a>
<a href="http://localhost/fie3.exe">file2.exe</a>
<a href="http://localhost/fie3.exe">file3.exe</a>
if i click the link file1.exe i just one to download it on my file downloader built in on my form.
how it works?
how to add file downloader?
my purpose is i just want to hide the links of the file that they downloading,thats why i want to add file downloader..
i can disable right click on my html using javascript so they can not view the source of html.
and i choose webbrowser so that i can update the links on my server.
anyone can help me?
thanks...
sorry for my english..
Last edited by Joke Sparrow; Oct 6th, 2009 at 03:22 AM.
Would this help you: Includes a progress bar
Add reference to WinHTTP.dll in systems32. (Browse to it, if Microsoft WinHTTP services doesn't show on the references list.)
Note this simple example doesn't do anything fancy, just dumps the downloaded bytes to disk.
OnResponseStart when you can safely access the headers.
OnResponseDataAvailable which returns a byte array of downloaded data for each chunk.
OnResponseEnd which ends the download.
Code:
Option Explicit
Private WithEvents http As WinHttpRequest
Private mContentLength As Long
Private mProgress As Long
Private Sub Command1_Click()
' Create the WinHTTPRequest ActiveX Object.
Set http = New WinHttpRequest
' Open an HTTP connection.
http.open "GET", "http://YourWebsite/file1.exe", True 'True means asynch.
' Send the HTTP Request.
http.send
End Sub
Private Sub http_OnResponseDataAvailable(Data() As Byte)
mProgress = mProgress + UBound(Data) + 1
ProgressBar1.Value = mProgress
Put #1, , Data
End Sub
Private Sub http_OnResponseFinished()
Close #1
MsgBox "done"
End Sub
Private Sub http_OnResponseStart(ByVal Status As Long, ByVal ContentType As String)
Text1.Text = http.getAllResponseHeaders()
mProgress = 0
mContentLength = CLng(http.getResponseHeader("Content-Length"))
ProgressBar1.Max = mContentLength
Open "C:\File1.exe" For Binary As #1
End Sub
Waiting for a full featured smart phone with out marrying a provider
Go Android
Go raiders
on my cmdfile1_click button
webbrowser1.navigate to my custome page
and when the page download complete it will search to a tag name file1,then get the links and put on the urltxt of downloader..