Hi,
Here is an example on how to download a file from a windows form.
You will need to add a webrequest.credentials to automatically logon to the
site.
http://msdn.microsoft.com/library/de...tialstopic.asp
Dim request As WebRequest
Dim response As WebResponse
Dim reader As Stream
Dim writer As Stream
Dim data(1023) As Byte
Dim count As Integer
Dim total As Integer
Me.Show()
Me.Text = "Downloading file ....."
Application.DoEvents()
request =
WebRequest.Create("http://www.onteorasoftware.com/downloads/multigrids.zip")
response = request.GetResponse()
reader = response.GetResponseStream()
ProgressBar1.Maximum = CInt(response.ContentLength)
ProgressBar1.Value = 0
total = 0
writer = File.Create("mylocaldata.zip")
While True
count = reader.Read(data, 0, 1024)
If count <= 0 Then
Exit While
End If
writer.Write(data, 0, count)
total += 1024
If total < ProgressBar1.Maximum Then ProgressBar1.Value = total
Application.DoEvents()
End While
reader.Close()
writer.Close()
Ken
--------------------------
"Nikolay Petrov" <jo******@mail.bg> wrote in message
news:uT**************@TK2MSFTNGP15.phx.gbl...
I have this problem.
I have to download a document from a web site in specified intervals of time
and save it to hdd.
The problem is that before I get to document I have to login to site by a
web form authentication.
The login form have an option to remember by login by storing a cookie on my
PC.
The question is may I somehow use this saved cookie in my VB app to get the
document, or is there a way to fill the login details in the login form?
TIA