Re: Single Logon



Thanks for your response Thom,

As for uploading whole file/folder structure, I think we have to followup
the FTP protocol rules, create folder on the serverside first then use
upload command to upload files .... FtpWebRequest is just a raw component
which implement those basic FTP verbs. Maybe some 3rd party guys will
implement a encapsulated one which provide a uploading/downloading folder
strucure fuctionality.. I think your current application is just
something like a simple GUI WYSIWYG ftp client, yes? I think most such
FTP client application just using the basic FTP commands(upload file, make
folder...) to implement complex operations(folder structure upload...).

Thanks & Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)



--------------------
| From: "Thom Little" <thom@xxxxxxxxxx>
| References: <uTnsZmu7FHA.3636@xxxxxxxxxxxxxxxxxxxx>
<33JHyyz7FHA.4000@xxxxxxxxxxxxxxxxxxxxx>
| Subject: Re: Single Logon
| Date: Tue, 22 Nov 2005 10:49:17 -0500
| Lines: 133
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
| X-RFC2646: Format=Flowed; Original
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
| Message-ID: <uaIpRx37FHA.740@xxxxxxxxxxxxxxxxxxxx>
| Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
| NNTP-Posting-Host: 65.99.185.176
| Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP11.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.aspnet.webcontrols:31269
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
|
| Thanks for the help.
|
| My final project in this area has probably already been done elsewhere.
I
| want to download or upload a complete tree structure. This will delete
| everything on the receiving end and then transfer the entire structure.
|
| The challenge is coming up with the recursive technique.
|
| Any leads would be appreciated.
|
| --
| -- Thom Little -- www.tlanet.net -- Thom Little Associates, Ltd.
| --
|
| "Steven Cheng[MSFT]" <stcheng@xxxxxxxxxxxxxxxxxxxx> wrote in message
| news:33JHyyz7FHA.4000@xxxxxxxxxxxxxxxxxxxxxxxx
| > Hi Thom,
| >
| > Welcome to ASPNET newsgroup.
| > As for the underlying internet connections which is used to serve the
| > WebRequest(HttpWebreuqest, FtpWebRequest...) calls, it is maintained by
| > the
| > underlying Connection Manager, we can not directly manually create or
| > control them. Actually in .NET System.Net namespaces , those WebRequest
| > components will retrieve a ServicePoint(which represent a connection to
a
| > remote resource ---- by URL) to perform the network operation. And these
| > SevicePoint objects are managed by the ServicePointManager... We can
| > configure some setting such as Max ServicePoint count..... (can also
| > configure through app config file). Also, for your scenario, I think
| > you
| > can consider using the "WebRequest.ConnectionGroupName" property to
| > specify
| > a certain Group Name for your FtpWebRequest components, for those
| > webrequest components which have the same ConnectionGroupName and
request
| > the same remote resource (same URL ...), the ServicePointManager (within
| > the same AppDomain) will try reusing and sharing ServicePoints for those
| > webrequest components(in same group...).
| >
| > #WebRequest.ConnectionGroupName Property
| >
http://msdn2.microsoft.com/en-us/library/system.net.webrequest.connectiongro
| > upname.aspx
| >
| > #ServicePointManager Class
| > http://msdn2.microsoft.com/en-us/library/zkfa48de(en-US,VS.80).aspx
| >
| > Hope helps. 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.)
| >
| >
| >
| >
| >
| > --------------------
| > | From: "Thom Little" <thom@xxxxxxxxxx>
| > | Subject: Single Logon
| > | Date: Mon, 21 Nov 2005 17:19:04 -0500
| > | Lines: 52
| > | X-Priority: 3
| > | X-MSMail-Priority: Normal
| > | X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
| > | X-RFC2646: Format=Flowed; Original
| > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
| > | Message-ID: <uTnsZmu7FHA.3636@xxxxxxxxxxxxxxxxxxxx>
| > | Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
| > | NNTP-Posting-Host: 65.99.185.176
| > | Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP09.phx.gbl
| > | Xref: TK2MSFTNGXA02.phx.gbl
| > microsoft.public.dotnet.framework.aspnet.webcontrols:31252
| > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
| > |
| > | The following will download every file in a remote directory ...
| > |
| > | public void DownloadDirectory(string strAddress, string
strUsername,
| > | string strPassword )
| > | {
| > | FtpWebRequest req = (FtpWebRequest)WebRequest.Create(c_strFtp +
| > | strAddress );
| > | req.Credentials = new NetworkCredential(strUsername, strPassword );
| > | req.Method = WebRequestMethods.Ftp.ListDirectory ;
| > | FtpWebResponse resp = (FtpWebResponse)req.GetResponse( );
| > | Stream rs = resp.GetResponseStream( );
| > | StreamReader sr = new StreamReader(rs, System.Text.Encoding.UTF8 );
| > | string[] strDirectory = sr.ReadToEnd().Trim( '\n' ).Split( '\n' );
| > | sr.Close( );
| > | rs.Close( );
| > | resp.Close( );
| > | foreach (string strFilename in strDirectory )
| > | this.DownloadFile( strFilename.Trim( '\r'), strAddress,
strUsername,
| > | strPassword );
| > | }
| > |
| > | private void DownloadFile( string strFilename, string strAddress,
| > string
| > | strUsername, string strPassword )
| > | {
| > | byte[] buf = new byte[2047] ;
| > | int iWork ;
| > | FtpWebRequest req = (FtpWebRequest)FtpWebRequest.Create( c_strFtp +
| > | strAddress + strFilename );
| > | req.Credentials = new NetworkCredential(strUsername, strPassword );
| > | req.Method = WebRequestMethods.Ftp.DownloadFile ;
| > | FtpWebResponse resp = (FtpWebResponse)req.GetResponse( );
| > | Stream rs = resp.GetResponseStream( );
| > | FileStream fs = new
FileStream(this.tbAddressClient.Text.ToString() +
| > | strFilename, FileMode.Create );
| > | while ( ( iWork = rs.Read( buf, 0, buf.Length ) ) > 0 )
| > | fs.Write( buf, 0, iWork );
| > | fs.Close( );
| > | rs.Close( );
| > | }
| > |
| > | ... the disadvantage is that every file downloaded requires a separate
| > | connection to be established.
| > |
| > | Is there an example of establishing a connection, downloading multiple
| > | files, closing connections?
| > |
| > | --
| > | -- Thom Little -- www.tlanet.net -- Thom Little Associates, Ltd.
| > | --
| > |
| > |
| > |
| > |
| >
|
|
|

.



Relevant Pages

  • Re: Silly query !
    ... The UpLoad Speed of a typical ADSL Connection is usually around about ... Connection Speeds - a Byte is normally 8 bits, ... YouSendit.com Server?) ... WebSpace, using FTP? ...
    (uk.people.silversurfers)
  • Net::FTPSSL problem (or how to do FTP over SSL another way?)
    ... I'm trying to write a simple script to upload a file to an FTP server ... Use of uninitialized value in join or string at ...
    (comp.lang.perl.misc)
  • Re: Can you use an FTP program with dial-up???
    ... > of them mention that they support FTP as opposed to BROWSER support. ... Yes you can use FTP upload to your web site if the host supports FTP, ... Since both methods involve use of the same connection from your ...
    (alt.html)
  • PHP File Upload Fails
    ... I am trying to do a FTP file upload which works fine on my localhost but on ... my ISP server it fails. ... // set up basic connection ...
    (comp.lang.php)
  • RE: strange upload trouble
    ... > The server is set to unlimited connections, ... > I start to upload a file. ... >, the server drops the connection and the ... FTP servers are not capable of holding more than one concurrent transfer to ...
    (microsoft.public.inetserver.iis.ftp)