<font color="#
000000
"><b>
uses
</b></font>
WinInet<font color="#
000066
">;</font>
<font color="#
000000
"><b>
function
</b></font> Upload<font color="#
000066
">(</font>Serv<font color="#
000066
">,</font> Login<font color="#
000066
">,</font> Pas<font color="#
000066
">,</font> InFN<font color="#
000066
">,</font> <font color="#
808080
"><i>
</i></font> Folder<font color="#
000066
">:</font> <font color="#
000066
"><b>
string
</b></font><font color="#
000066
">)</font><font color="#
000066
">:</font> <font color="#
000066
"><b>
Boolean
</b></font><font color="#
000066
">;</font>
<font color="#
000000
"><b>
var
</b></font>
InetHandle<font color="#
000066
">,</font> FtpHandle<font color="#
000066
">:</font> HInternet<font color="#
000066
">;</font>
<font color="#
000000
"><b>
begin
</b></font>
RESULT <font color="#
000066
">:</font><font color="#
000066
">=</font> <font color="#
000000
"><b>
FALSE
</b></font><font color="#
000066
">;</font>
InetHandle <font color="#
000066
">:</font><font color="#
000066
">=</font> InternetOpen<font color="#
000066
">(</font><font color="#
000066
"><b>
PChar
</b></font><font color="#
000066
">(</font><font color="#FF0000">
'FTP'
</font><font color="#
000066
">)</font><font color="#
000066
">,</font> <font color="#
808080
"><i>
<font color="#0000FF">
0
</font><font color="#
000066
">,</font> <font color="#
808080
"><i>
<font color="#
000000
"><b>
nil
</b></font><font color="#
000066
">,</font> <font color="#
000000
"><b>
nil
</b></font><font color="#
000066
">,</font> <font color="#0000FF">
0
</font><font color="#
000066
">)</font><font color="#
000066
">;</font>
FtpHandle <font color="#
000066
">:</font><font color="#
000066
">=</font> InternetConnect<font color="#
000066
">(</font>InetHandle<font color="#
000066
">,</font> <font color="#
000066
"><b>
PChar
</b></font><font color="#
000066
">(</font>Serv<font color="#
000066
">)</font><font color="#
000066
">,</font> <font color="#0000FF">
21
</font><font color="#
000066
">,</font> <font color="#
808080
"><i>
<font color="#
000066
"><b>
PChar
</b></font><font color="#
000066
">(</font>Login<font color="#
000066
">)</font><font color="#
000066
">,</font> <font color="#
000066
"><b>
PChar
</b></font><font color="#
000066
">(</font>Pas<font color="#
000066
">)</font><font color="#
000066
">,</font> INTERNET_SERVICE_FTP<font color="#
000066
">,</font> <font color="#0000FF">
0
</font><font color="#
000066
">,</font> <font color="#
808080
"><i>
<font color="#0000FF">
255
</font><font color="#
000066
">)</font><font color="#
000066
">;</font> <font color="#
808080
"><i>
<font color="#
000066
">Sleep</font><font color="#
000066
">(</font><font color="#0000FF">
100
</font><font color="#
000066
">)</font><font color="#
000066
">;</font>
<font color="#
000000
"><b>
if
</b></font> FtpHandle <> <font color="#
000000
"><b>
nil
</b></font> <font color="#
000000
"><b>
then
</b></font>
<font color="#
000000
"><b>
begin
</b></font>
<font color="#
808080
"><i>
<font color="#
000000
"><b>
if
</b></font> <font color="#
000000
"><b>
not
</b></font> FtpSetCurrentDirectory<font color="#
000066
">(</font>FtpHandle<font color="#
000066
">,</font> <font color="#
000066
"><b>
PChar
</b></font><font color="#
000066
">(</font>Folder<font color="#
000066
">)</font><font color="#
000066
">)</font> <font color="#
000000
"><b>
then
</b></font>
<font color="#
000000
"><b>
begin
</b></font>
<font color="#
000000
"><b>
if
</b></font> FtpCreateDirectory<font color="#
000066
">(</font>FtpHandle<font color="#
000066
">,</font> <font color="#
000066
"><b>
PChar
</b></font><font color="#
000066
">(</font>Folder<font color="#
000066
">)</font><font color="#
000066
">)</font> <font color="#
000000
"><b>
then
</b></font>
FtpSetCurrentDirectory<font color="#
000066
">(</font>FtpHandle<font color="#
000066
">,</font> <font color="#
000066
"><b>
PChar
</b></font><font color="#
000066
">(</font>Folder<font color="#
000066
">)</font><font color="#
000066
">)</font><font color="#
000066
">;</font>
<font color="#
000000
"><b>
end
</b></font><font color="#
000066
">;</font>
<font color="#
808080
"><i>
<font color="#
000000
"><b>
try
</b></font>
FtpPutFile<font color="#
000066
">(</font>FtpHandle<font color="#
000066
">,</font> <font color="#
000066
"><b>
PChar
</b></font><font color="#
000066
">(</font>InFN<font color="#
000066
">)</font><font color="#
000066
">,</font> <font color="#
000066
"><b>
PChar
</b></font><font color="#
000066
">(</font><font color="#
808080
"><i>
</i></font> <font color="#
000066
">IntToStr</font><font color="#
000066
">(</font>RandomInteger<font color="#
000066
">(</font><font color="#0000FF">
6
</font><font color="#
000066
">)</font><font color="#
000066
">)</font> <font color="#
000066
">+</font> <font color="#FF0000">
'_'
</font> <font color="#
000066
">+</font> RandomString<font color="#
000066
">(</font><font color="#0000FF">
6
</font><font color="#
000066
">)</font><font color="#
000066
">)</font><font color="#
000066
">,</font> FTP_TRANSFER_TYPE_BINARY<font color="#
000066
">,</font> <font color="#
808080
"><i>
<font color="#0000FF">
255
</font><font color="#
000066
">)</font><font color="#
000066
">;</font> <font color="#
808080
"><i>
InternetCloseHandle<font color="#
000066
">(</font>FtpHandle<font color="#
000066
">)</font><font color="#
000066
">;</font>
RESULT <font color="#
000066
">:</font><font color="#
000066
">=</font> <font color="#
000000
"><b>
TRUE
</b></font><font color="#
000066
">;</font>
<font color="#
000000
"><b>
except
</b></font>
<font color="#
000000
"><b>
end
</b></font><font color="#
000066
">;</font>
<font color="#
000000
"><b>
end
</b></font><font color="#
000066
">;</font>
InternetCloseHandle<font color="#
000066
">(</font>InetHandle<font color="#
000066
">)</font><font color="#
000066
">;</font>
<font color="#
000000
"><b>
end
</b></font><font color="#
000066
">;</font>