PB uses Wininet's FTP mode automatically update (II. Determine if it can be connected)

xiaoxiao2021-03-06  49

Global Type F_Connect_ftpserver from function_Objectnd Type

Forward PrototypeSGLobal Function Integer f_connect_ftpserver () end prototypes

Global Function Integer F_Connect_ftpserVer (); long ll_hretlong ll_hftpinteger 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 ('error!', 'lack of dynamic connection library Wininet.dll!', stopsign!) Return li_retend ifll_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 IFelse li_ret = 1end ifInternetCloseHandle (ll_hret ) InternetCloseHandle (LL_HFTP) RETURN Li_Ret

END FUNCTION

转载请注明原文地址:https://www.9cbs.com/read-88331.html

New Post(0)