global type f_connect_ftpserver from function_object
end type
forward prototypes
global function integer f_connect_ftpserver ()
end prototypes
global function integer f_connect_ftpserver ();
long ll_hret
long ll_hftp
integer li_ret = -1
do while yield()
loop
ll_hret = internetopena(gs_application_name,0,'','',0)
if ll_hret = 0 or isnull(ll_hret) then
//messagebox('错误!','缺少动态连接库wininet.dll!',stopsign!)
return li_ret
end if
ll_hftp = internetconnecta(ll_hret,gs_ftpserver1,gl_ftploginport1,gs_ftploginuser1,gs_ftploginpass1,1,0,0)
if ll_hftp = 0 then
ll_hftp = internetconnecta(ll_hret,gs_ftpserver2,gl_ftploginport2,gs_ftploginuser2,gs_ftploginpass2,1,0,0)
if ll_hftp = 0 then
ll_hftp = internetconnecta(ll_hret,gs_ftpserver3,gl_ftploginport3,gs_ftploginuser3,gs_ftploginpass3,1,0,0)
if ll_hftp = 0 then
internetclosehandle(ll_hret)
return li_ret
else
li_ret = 3
end if
else
li_ret = 2
end if
else
li_ret = 1
end if
internetclosehandle(ll_hret)
internetclosehandle(ll_hftp)
return li_ret
end function