Thanks for netnoobie's input.
Hi Thom,
As for the WebClient class is using the WebRequest component internally, so
it can only access remote resources through the existing registred
WebRequest components. For .net 1.1, there is only Http/https based or
local File:// protocol based component avaliable. So we can not use the
WebClient class to access remote resource through FTP protocol. Also, in
..NET 2.0 there has provided FtpWebRequest and FtpWebResponse class as
build-in components which can help performing FTP resource accessing.
#FtpWebRequest Class
http://msdn2.microsoft.com/en-us/library/system.net.ftpwebrequest.aspx
Thanks,
Steven Cheng
Microsoft Online Support
Get Secure!
www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
--------------------
| Thread-Topic: WebCLient
| thread-index: AcXnK+cCEvfE4T5DRuSU78rr4/DguA==
| X-WBNR-Posting-Host: 202.172.113.6
| From: "=?Utf-8?B?Lm5ldCBub29iaWU=?=" <
[email protected]>
| References: <
[email protected]>
| Subject: RE: WebCLient
| Date: Fri, 11 Nov 2005 17:53:39 -0800
| Lines: 47
| Message-ID: <
[email protected]>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
| NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGXA03.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.aspnet.webcontrols:31101
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
|
|
http://www.dotgnu.org/pnetlib-doc/System/Net/WebRequest.html
|
| using System;
| using System.Net;
|
| public class ftpWebRequest : WebRequest {
| //implement ftp-specific protocol methods and properties
| }
|
| public class ftpCreator : IWebRequestCreate
| {
| public WebRequest Create(Uri uri)
| {
| return new ftpWebRequest();
| }
| }
|
| public class RegisterPrefixExample
| {
|
| public static void Main()
| {
|
| ftpCreator creator = new ftpCreator();
| WebRequest.RegisterPrefix("ftp://", creator);
| WebRequest wr = WebRequest.Create("ftp://testFile");
| Console.WriteLine(wr);
| }
| }
|
|
| "Thom Little" wrote:
|
| > Is it possible to use WebClient.DownloadFile and WebClient.UploadFile
to a
| > FTP server that requires a user name and password?
| >
| > If yes, how is the authentication information passed to the server?
| >
| > What was the source of your information?
| >
| > --
| > -- Thom Little --
www.tlanet.net -- Thom Little Associates, Ltd.
| > --
| >
| >
| >
| >
|