New FTP Control

S

scorpion53061

I am trying using vb.net 2005 to backup my AIX Server to my Windows
computer. I thought using the new FTP control it would be a snap.

What it is suppose to do is connect to the server and start copying the
server to the backup folder creating directories and subdirectories as
needed.

I can get one file and I can create the directory and get those files but
getting the subdirectories and its files is where I am having troubles. Has
anyone tried to do something similar to this?
 
T

Tom Spink

scorpion53061 said:
I am trying using vb.net 2005 to backup my AIX Server to my Windows
computer. I thought using the new FTP control it would be a snap.

What it is suppose to do is connect to the server and start copying the
server to the backup folder creating directories and subdirectories as
needed.

I can get one file and I can create the directory and get those files but
getting the subdirectories and its files is where I am having troubles.
Has anyone tried to do something similar to this?

Hi,

Are you having trouble enumerating recursively through a directory?

-- Tom
OrElse what...
 
T

Tom Spink

scorpion53061 said:
Yes exactly.

Hi,

Well, here is a function that recursively scans a directory.

Imports System.IO

Public Function RecurseDir ( szStartDir As String )

Dim strFiles As String() = Directory.GetFiles( szStartDir )
Dim strDirs As String() = Directory.GetDirectories( szStartDir )

For Each strFile As String In strFiles
DoSomethingWithFile( strFile ) ' Copy it?
Next strFile

For Each strDir As String In strDirs
DoSomethingWithDir( strDir ) ' Create it?
RecurseDir( strDir )
Next strDir

End Function

(Just a note: I haven't tested this at all.)

-- Tom
OrElse what...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top