W Ten Sposób using the kod od ten połączenie:
[pustka] [Reflection.Assembly
]:: LoadFrom ("C:\IndyNet - Daily-20051007 \ Indy.Sockets.dll")
$ftp = nowy-protestować Indy.Sockets.FTP
$ftp. Rozłączenie ()
$ftp. Gospodarz = $ftphost
$ftp. Username = $username
$ftp. Hasło = $password
$ftp. Łączyć ()
$ftp. Passive=$true;
wc = nowy-protestować System.Net.WebClient
$wc. Referencje = Nowy-Protestować System.Net.NetworkCredential ($strFtpUser, $strFtpPass)
$ls = nowy-protestować System.Collections.Specialized.StringCollection;
$ftp. Lista ($ls, "", $true);
foreach ($file w $ls) {
"Ściągać {(0)} w {(1)}." - f $sourceFileName, $targetDir;
$ftp. Dostawać ($sourceFileName, ($targetDir + $sourceFileName), $true, $false);
}