473,404 Members | 2,137 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

myWebClient.DownloadFile Question

I'm trying to download a file from the Web Server to the user's
desktop using myWebClient.DownloadFile as described by Microsoft at
http://msdn.microsoft.com/en-us/library/ez801hhe.aspx.

2 Questions:

1.) Is this the best approach?
2.) Is there a way to have the default download location as the
User's Desktop?

Thanks
Oct 17 '08 #1
1 1688
The second argument to DownloadFile is the local destination, which can be a
full path. In the example they only specified a file in the working
directory. You should specify a file using
Environment.GetFolderPath(Environment.SpecialFolde r.Desktop), as part of the
full path.

To answer question 1, it is certainly the simplest to impliment.

"Dave" wrote:
I'm trying to download a file from the Web Server to the user's
desktop using myWebClient.DownloadFile as described by Microsoft at
http://msdn.microsoft.com/en-us/library/ez801hhe.aspx.

2 Questions:

1.) Is this the best approach?
2.) Is there a way to have the default download location as the
User's Desktop?

Thanks
Oct 17 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: James Write | last post by:
Hi, I am using the webclient.downloadfile() method to download a file from a remote web server to the local harddrive. public CopyFile(string sSrcPath, string sDestPath) { WebClient oClient...
6
by: A.M-SG | last post by:
Hi, I have an aspx page at the web server that provides PDF documents for smart client applications. Here is the code in aspx page that defines content type: Response.ContentType =...
8
by: DEWright_CA | last post by:
Why does WebClient.DownloadFile loose my completed path? Ok, I have a function in my app then when my button is clicked it checks to see if the files come from a local drive or a http address....
0
by: Mike Lincoln | last post by:
I am trying to write a program to download files from the Internet, I know using webClient.Downloadfile(RemoteDir + remoteFileName, LocalFileName) can download a singles file, my question is, if...
6
by: Morten Snedker | last post by:
I have this Class: Imports System.Net Public Class DownloadFile Private _webClt As WebClient Private _url As String Private _file As String Sub New(ByVal urlSource As String, ByVal...
2
by: Bill Sempf | last post by:
Hi, all. I have a networking question, really. I have this line of code: my.computer.network.downloadfile("\\1.2.3.4\c$\file.txt", "c:\ifle.txt", "user", "pass") When I run it, I get an...
3
by: Chip | last post by:
Hi, How do I add a required cookie to my WebClient.DownloadFile() request? Chip
8
by: =?Utf-8?B?UnVpIE9saXZlaXJh?= | last post by:
WebClient.DownloadFile I am using the WebClient.DownloadFile function to download a file from server to a local client. When I execute the below code, file is created in server and not in...
2
by: Dave | last post by:
I'm trying to download a file from the Web Server to the user's desktop using myWebClient.DownloadFile as described by Microsoft at http://msdn.microsoft.com/en-us/library/ez801hhe.aspx. 2...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.