|
-
Sep 23rd, 2003, 07:30 AM
#1
Thread Starter
Fanatic Member
download
Hi everyone,
Could you giude me on the following topic please, or what topic does this come under?
Thanks
I would like to download files from a web site and place them on my local machine.
-
Sep 23rd, 2003, 07:42 AM
#2
Sleep mode
Very basic code for downloading files :
VB Code:
Dim dl As New Net.WebClient
dl.DownloadFile(-,-)
-
Nov 18th, 2003, 08:50 PM
#3
New Member
I am trying to download a file, and using the code above gives me a 407 error (Proxy Authentication Required). I can't download any files from any site, so it's not a password-related issue. Could it be something to do with the server at my end? Any ideas would be much appreciated.
Thanks,
Vulpes
-
Nov 18th, 2003, 11:27 PM
#4
Frenzied Member
Yes, you are using an authenticating proxy to connect to internet. This settings works for any program that tries to use the Internet Settigns of Windows, however some browsers like Netscape and Opera use their own settings.
'Heading for the automatic overload'
Marillion, Brave, The Great Escape, 1994
'How will WE stand the FIRE TOMORROW?'
Eloy, Silent Cries and Mighty Echoes, The Vision - Burning, 1979
-
Nov 19th, 2003, 06:18 AM
#5
Frenzied Member
To authenticate proxy you can use:
VB Code:
Dim dl As New Net.WebClient
Dim wp As New Net.WebProxy("proxyserver", portnumber)
Dim cr As New System.Net.NetworkCredential("username", "pass")
wp.Credentials = cr
Net.GlobalProxySelection.Select = wp
dl.DownloadFile("url", "file")
'Heading for the automatic overload'
Marillion, Brave, The Great Escape, 1994
'How will WE stand the FIRE TOMORROW?'
Eloy, Silent Cries and Mighty Echoes, The Vision - Burning, 1979
-
Nov 19th, 2003, 03:53 PM
#6
New Member
Thanks Lunatic3 - just to clarify, "username", "pass" and "proxyserver" refer to my local domain settings?
-
Nov 19th, 2003, 06:01 PM
#7
Frenzied Member
Yes, but not necessarily. Sometimes to connect to special resources you need to connect through a proxy server that is not on your local domain. And also you can have a settings part in your program that lets user set the proxy server and then a pop up window that asks for username and password.
'Heading for the automatic overload'
Marillion, Brave, The Great Escape, 1994
'How will WE stand the FIRE TOMORROW?'
Eloy, Silent Cries and Mighty Echoes, The Vision - Burning, 1979
-
Nov 19th, 2003, 06:05 PM
#8
New Member
Thanks again for the help - I just managed to get it working about 5 minutes ago. Ironically the hardest part so far was finding out the name of the local proxy server 
-Vulpes
-
Nov 19th, 2003, 07:02 PM
#9
Frenzied Member
There is a method that automatically deted the nondynamic proxy settings of Internet Explorer
VB Code:
Try
Dim wp As New Net.WebProxy(Net.WebProxy.GetDefaultProxy.Address)
MessageBox.Show(wp.Address.ToString)
Catch ex As Exception
'Either no proxy or some other errors.
End Try
'Heading for the automatic overload'
Marillion, Brave, The Great Escape, 1994
'How will WE stand the FIRE TOMORROW?'
Eloy, Silent Cries and Mighty Echoes, The Vision - Burning, 1979
-
Nov 19th, 2003, 07:49 PM
#10
New Member
Wow that'll save me some time - was wondering how I would make the program work for anyone. Thanks again 
-Vulpes
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
|