Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- **********************************************************************************
- *... FTPPut.PRG ...*
- Parameters lchost, lcuser, lcpassword, lcsource, lctarget, lnxfertype
- *.................................................................................
- *: Usage: DO ftpput WITH ;
- *: 'ftp.host', 'name', 'password', 'source.file', 'target.file'[, 1 | 2]
- *:
- *: Where: lcHost = Host computer IP address or name
- *: lcUser = user name - anonymous may be used
- *: lcPassword = password
- *: lcSource = source file name (remote)
- *: lcTarget = target file name (local)
- *: lnXFerType = 1 (default) for ascii, 2 for binary
- *.................................................................................
- Declare Integer InternetOpen In wininet.Dll;
- STRING sAgent,;
- INTEGER lAccessType,;
- STRING sProxyName,;
- STRING sProxyBypass,;
- STRING lFlags
- Declare Integer InternetCloseHandle In wininet.Dll Integer hInet
- Declare Integer InternetConnect In wininet.Dll;
- INTEGER hInternetSession,;
- STRING lcHost,;
- INTEGER nServerPort,;
- STRING lcUser,;
- STRING lcPassword,;
- INTEGER lService,;
- INTEGER lFlags,;
- INTEGER lContext
- Declare Integer FtpPutFile In wininet.Dll;
- INTEGER hConnect,;
- STRING lpszLocalFile,;
- STRING lpszNewRemoteFile,;
- INTEGER dwFlags,;
- INTEGER dwContext
- Declare Integer FtpDeleteFile In wininet.Dll;
- INTEGER hConnect,;
- STRING lpszFileName
- Public hopen, hftpsession
- lchost = Alltrim(lchost)
- lcuser = Alltrim(lcuser)
- lcpassword = Alltrim(lcpassword)
- lcsource = Alltrim(lcsource)
- lctarget = Alltrim(lctarget)
- If connect2ftp (lchost, lcuser, lcpassword)
- ** Sukses sampai disini
- Wait Window 'Transferring File....' Nowait Nocle
- If ftpputfile(hftpsession, lcsource, lctarget, 1, 0) = 1
- Wait Window lcsource + ' File Transferred.' Nowait Nocle
- Else
- Wait Window lcsource + ' File NOT Transferred.' Nowait Nocle
- Endif
- = internetclosehandle (hftpsession)
- = internetclosehandle (hopen)
- Wait Clear
- Endif
- *..................... connect2ftp .........................................
- *... Makes sure there is actually a valid connection to the host
- Function connect2ftp (lchost, lcuser, lcpassword)
- * open access to Inet functions
- hopen = internetopen ("vfp", 1, 0, 0, 0)
- If hopen = 0
- Return .F.
- Endif
- *... The first '0' says use the default port, usually 21.
- hftpsession = internetconnect (hopen, lchost,;
- 0, lcuser, lcpassword, 1, 0, 0) &&... 1 = ftp protocol
- If hftpsession = 0
- * close access to Inet functions and exit
- = internetclosehandle (hopen)
- *!* ? "ftp " + lcHost + " is not available"
- Return .F.
- Else
- *!* ? "Connected to " + lcHost
- Endif
- Return .T.
- Return
- *** End of ftpPut.PRG ***********************************************************
- *... FTPPut.PRG ...*
- Parameters lchost, lcuser, lcpassword, lcsource, lctarget, lnxfertype
- *.................................................................................
- *: Usage: DO ftpput WITH ;
- *: 'ftp.host', 'name', 'password', 'source.file', 'target.file'[, 1 | 2]
- *:
- *: Where: lcHost = Host computer IP address or name
- *: lcUser = user name - anonymous may be used
- *: lcPassword = password
- *: lcSource = source file name (remote)
- *: lcTarget = target file name (local)
- *: lnXFerType = 1 (default) for ascii, 2 for binary
- *.................................................................................
- Declare Integer InternetOpen In wininet.Dll;
- STRING sAgent,;
- INTEGER lAccessType,;
- STRING sProxyName,;
- STRING sProxyBypass,;
- STRING lFlags
- Declare Integer InternetCloseHandle In wininet.Dll Integer hInet
- Declare Integer InternetConnect In wininet.Dll;
- INTEGER hInternetSession,;
- STRING lcHost,;
- INTEGER nServerPort,;
- STRING lcUser,;
- STRING lcPassword,;
- INTEGER lService,;
- INTEGER lFlags,;
- INTEGER lContext
- Declare Integer FtpPutFile In wininet.Dll;
- INTEGER hConnect,;
- STRING lpszLocalFile,;
- STRING lpszNewRemoteFile,;
- INTEGER dwFlags,;
- INTEGER dwContext
- Declare Integer FtpDeleteFile In wininet.Dll;
- INTEGER hConnect,;
- STRING lpszFileName
- Public hopen, hftpsession
- lchost = Alltrim(lchost)
- lcuser = Alltrim(lcuser)
- lcpassword = Alltrim(lcpassword)
- lcsource = Alltrim(lcsource)
- lctarget = Alltrim(lctarget)
- If connect2ftp (lchost, lcuser, lcpassword)
- ** Sukses sampai disini
- Wait Window 'Transferring File....' Nowait Nocle
- If ftpputfile(hftpsession, lcsource, lctarget, 1, 0) = 1
- Wait Window lcsource + ' File Transferred.' Nowait Nocle
- Else
- Wait Window lcsource + ' File NOT Transferred.' Nowait Nocle
- Endif
- = internetclosehandle (hftpsession)
- = internetclosehandle (hopen)
- Wait Clear
- Endif
- *..................... connect2ftp .........................................
- *... Makes sure there is actually a valid connection to the host
- Function connect2ftp (lchost, lcuser, lcpassword)
- * open access to Inet functions
- hopen = internetopen ("vfp", 1, 0, 0, 0)
- If hopen = 0
- Return .F.
- Endif
- *... The first '0' says use the default port, usually 21.
- hftpsession = internetconnect (hopen, lchost,;
- 0, lcuser, lcpassword, 1, 0, 0) &&... 1 = ftp protocol
- If hftpsession = 0
- * close access to Inet functions and exit
- = internetclosehandle (hopen)
- *!* ? "ftp " + lcHost + " is not available"
- Return .F.
- Else
- *!* ? "Connected to " + lcHost
- Endif
- Return .T.
- Return
- *** End of ftpPut.PRG ***********************************************************
- *.................................................................................
- *: Usage: DO ftpput WITH ;
- *: 'ftp.host', 'name', 'password', 'source.file', 'target.file'[, 1 | 2]
- *:
- *: Where: lcHost = Host computer IP address or name
- *: lcUser = user name - anonymous may be used
- *: lcPassword = password
- *: lcSource = source file name (remote)
- *: lcTarget = target file name (local)
- *: lnXFerType = 1 (default) for ascii, 2 for binary
- *.................................................................................
- Declare Integer InternetOpen In wininet.Dll;
- STRING sAgent,;
- INTEGER lAccessType,;
- STRING sProxyName,;
- STRING sProxyBypass,;
- STRING lFlags
- Declare Integer InternetCloseHandle In wininet.Dll Integer hInet
- Declare Integer InternetConnect In wininet.Dll;
- INTEGER hInternetSession,;
- STRING lcHost,;
- INTEGER nServerPort,;
- STRING lcUser,;
- STRING lcPassword,;
- INTEGER lService,;
- INTEGER lFlags,;
- INTEGER lContext
- Declare Integer FtpPutFile In wininet.Dll;
- INTEGER hConnect,;
- STRING lpszLocalFile,;
- STRING lpszNewRemoteFile,;
- INTEGER dwFlags,;
- INTEGER dwContext
- Declare Integer FtpDeleteFile In wininet.Dll;
- INTEGER hConnect,;
- STRING lpszFileName
- Public hopen, hftpsession
- lchost = Alltrim(lchost)
- lcuser = Alltrim(lcuser)
- lcpassword = Alltrim(lcpassword)
- lcsource = Alltrim(lcsource)
- lctarget = Alltrim(lctarget)
- If connect2ftp (lchost, lcuser, lcpassword)
- ** Sukses sampai disini
- Wait Window 'Transferring File....' Nowait Nocle
- If ftpputfile(hftpsession, lcsource, lctarget, 1, 0) = 1
- Wait Window lcsource + ' File Transferred.' Nowait Nocle
- Else
- Wait Window lcsource + ' File NOT Transferred.' Nowait Nocle
- Endif
- = internetclosehandle (hftpsession)
- = internetclosehandle (hopen)
- Wait Clear
- Endif
- *..................... connect2ftp .........................................
- *... Makes sure there is actually a valid connection to the host
- Function connect2ftp (lchost, lcuser, lcpassword)
- * open access to Inet functions
- hopen = internetopen ("vfp", 1, 0, 0, 0)
- If hopen = 0
- Return .F.
- Endif
- *... The first '0' says use the default port, usually 21.
- hftpsession = internetconnect (hopen, lchost,;
- 0, lcuser, lcpassword, 1, 0, 0) &&... 1 = ftp protocol
- If hftpsession = 0
- * close access to Inet functions and exit
- = internetclosehandle (hopen)
- *!* ? "ftp " + lcHost + " is not available"
- Return .F.
- Else
- *!* ? "Connected to " + lcHost
- Endif
- Return .T.
- Return
- *** End of ftpPut.PRG ***********************************************************
- *: Usage: DO ftpput WITH ;
- *: 'ftp.host', 'name', 'password', 'source.file', 'target.file'[, 1 | 2]
- *:
- *: Where: lcHost = Host computer IP address or name
- *: lcUser = user name - anonymous may be used
- *: lcPassword = password
- *: lcSource = source file name (remote)
- *: lcTarget = target file name (local)
- *: lnXFerType = 1 (default) for ascii, 2 for binary
- *.................................................................................
- Declare Integer InternetOpen In wininet.Dll;
- STRING sAgent,;
- INTEGER lAccessType,;
- STRING sProxyName,;
- STRING sProxyBypass,;
- STRING lFlags
- Declare Integer InternetCloseHandle In wininet.Dll Integer hInet
- Declare Integer InternetConnect In wininet.Dll;
- INTEGER hInternetSession,;
- STRING lcHost,;
- INTEGER nServerPort,;
- STRING lcUser,;
- STRING lcPassword,;
- INTEGER lService,;
- INTEGER lFlags,;
- INTEGER lContext
- Declare Integer FtpPutFile In wininet.Dll;
- INTEGER hConnect,;
- STRING lpszLocalFile,;
- STRING lpszNewRemoteFile,;
- INTEGER dwFlags,;
- INTEGER dwContext
- Declare Integer FtpDeleteFile In wininet.Dll;
- INTEGER hConnect,;
- STRING lpszFileName
- Public hopen, hftpsession
- lchost = Alltrim(lchost)
- lcuser = Alltrim(lcuser)
- lcpassword = Alltrim(lcpassword)
- lcsource = Alltrim(lcsource)
- lctarget = Alltrim(lctarget)
- If connect2ftp (lchost, lcuser, lcpassword)
- ** Sukses sampai disini
- Wait Window 'Transferring File....' Nowait Nocle
- If ftpputfile(hftpsession, lcsource, lctarget, 1, 0) = 1
- Wait Window lcsource + ' File Transferred.' Nowait Nocle
- Else
- Wait Window lcsource + ' File NOT Transferred.' Nowait Nocle
- Endif
- = internetclosehandle (hftpsession)
- = internetclosehandle (hopen)
- Wait Clear
- Endif
- *..................... connect2ftp .........................................
- *... Makes sure there is actually a valid connection to the host
- Function connect2ftp (lchost, lcuser, lcpassword)
- * open access to Inet functions
- hopen = internetopen ("vfp", 1, 0, 0, 0)
- If hopen = 0
- Return .F.
- Endif
- *... The first '0' says use the default port, usually 21.
- hftpsession = internetconnect (hopen, lchost,;
- 0, lcuser, lcpassword, 1, 0, 0) &&... 1 = ftp protocol
- If hftpsession = 0
- * close access to Inet functions and exit
- = internetclosehandle (hopen)
- *!* ? "ftp " + lcHost + " is not available"
- Return .F.
- Else
- *!* ? "Connected to " + lcHost
- Endif
- Return .T.
- Return
- *** End of ftpPut.PRG ***********************************************************
- *: 'ftp.host', 'name', 'password', 'source.file', 'target.file'[, 1 | 2]
- *:
- *: Where: lcHost = Host computer IP address or name
- *: lcUser = user name - anonymous may be used
- *: lcPassword = password
- *: lcSource = source file name (remote)
- *: lcTarget = target file name (local)
- *: lnXFerType = 1 (default) for ascii, 2 for binary
- *.................................................................................
- Declare Integer InternetOpen In wininet.Dll;
- STRING sAgent,;
- INTEGER lAccessType,;
- STRING sProxyName,;
- STRING sProxyBypass,;
- STRING lFlags
- Declare Integer InternetCloseHandle In wininet.Dll Integer hInet
- Declare Integer InternetConnect In wininet.Dll;
- INTEGER hInternetSession,;
- STRING lcHost,;
- INTEGER nServerPort,;
- STRING lcUser,;
- STRING lcPassword,;
- INTEGER lService,;
- INTEGER lFlags,;
- INTEGER lContext
- Declare Integer FtpPutFile In wininet.Dll;
- INTEGER hConnect,;
- STRING lpszLocalFile,;
- STRING lpszNewRemoteFile,;
- INTEGER dwFlags,;
- INTEGER dwContext
- Declare Integer FtpDeleteFile In wininet.Dll;
- INTEGER hConnect,;
- STRING lpszFileName
- Public hopen, hftpsession
- lchost = Alltrim(lchost)
- lcuser = Alltrim(lcuser)
- lcpassword = Alltrim(lcpassword)
- lcsource = Alltrim(lcsource)
- lctarget = Alltrim(lctarget)
- If connect2ftp (lchost, lcuser, lcpassword)
- ** Sukses sampai disini
- Wait Window 'Transferring File....' Nowait Nocle
- If ftpputfile(hftpsession, lcsource, lctarget, 1, 0) = 1
- Wait Window lcsource + ' File Transferred.' Nowait Nocle
- Else
- Wait Window lcsource + ' File NOT Transferred.' Nowait Nocle
- Endif
- = internetclosehandle (hftpsession)
- = internetclosehandle (hopen)
- Wait Clear
- Endif
- *..................... connect2ftp .........................................
- *... Makes sure there is actually a valid connection to the host
- Function connect2ftp (lchost, lcuser, lcpassword)
- * open access to Inet functions
- hopen = internetopen ("vfp", 1, 0, 0, 0)
- If hopen = 0
- Return .F.
- Endif
- *... The first '0' says use the default port, usually 21.
- hftpsession = internetconnect (hopen, lchost,;
- 0, lcuser, lcpassword, 1, 0, 0) &&... 1 = ftp protocol
- If hftpsession = 0
- * close access to Inet functions and exit
- = internetclosehandle (hopen)
- *!* ? "ftp " + lcHost + " is not available"
- Return .F.
- Else
- *!* ? "Connected to " + lcHost
- Endif
- Return .T.
- Return
- *** End of ftpPut.PRG ***********************************************************
- *:
- *: Where: lcHost = Host computer IP address or name
- *: lcUser = user name - anonymous may be used
- *: lcPassword = password
- *: lcSource = source file name (remote)
- *: lcTarget = target file name (local)
- *: lnXFerType = 1 (default) for ascii, 2 for binary
- *.................................................................................
- Declare Integer InternetOpen In wininet.Dll;
- STRING sAgent,;
- INTEGER lAccessType,;
- STRING sProxyName,;
- STRING sProxyBypass,;
- STRING lFlags
- Declare Integer InternetCloseHandle In wininet.Dll Integer hInet
- Declare Integer InternetConnect In wininet.Dll;
- INTEGER hInternetSession,;
- STRING lcHost,;
- INTEGER nServerPort,;
- STRING lcUser,;
- STRING lcPassword,;
- INTEGER lService,;
- INTEGER lFlags,;
- INTEGER lContext
- Declare Integer FtpPutFile In wininet.Dll;
- INTEGER hConnect,;
- STRING lpszLocalFile,;
- STRING lpszNewRemoteFile,;
- INTEGER dwFlags,;
- INTEGER dwContext
- Declare Integer FtpDeleteFile In wininet.Dll;
- INTEGER hConnect,;
- STRING lpszFileName
- Public hopen, hftpsession
- lchost = Alltrim(lchost)
- lcuser = Alltrim(lcuser)
- lcpassword = Alltrim(lcpassword)
- lcsource = Alltrim(lcsource)
- lctarget = Alltrim(lctarget)
- If connect2ftp (lchost, lcuser, lcpassword)
- ** Sukses sampai disini
- Wait Window 'Transferring File....' Nowait Nocle
- If ftpputfile(hftpsession, lcsource, lctarget, 1, 0) = 1
- Wait Window lcsource + ' File Transferred.' Nowait Nocle
- Else
- Wait Window lcsource + ' File NOT Transferred.' Nowait Nocle
- Endif
- = internetclosehandle (hftpsession)
- = internetclosehandle (hopen)
- Wait Clear
- Endif
- *..................... connect2ftp .........................................
- *... Makes sure there is actually a valid connection to the host
- Function connect2ftp (lchost, lcuser, lcpassword)
- * open access to Inet functions
- hopen = internetopen ("vfp", 1, 0, 0, 0)
- If hopen = 0
- Return .F.
- Endif
- *... The first '0' says use the default port, usually 21.
- hftpsession = internetconnect (hopen, lchost,;
- 0, lcuser, lcpassword, 1, 0, 0) &&... 1 = ftp protocol
- If hftpsession = 0
- * close access to Inet functions and exit
- = internetclosehandle (hopen)
- *!* ? "ftp " + lcHost + " is not available"
- Return .F.
- Else
- *!* ? "Connected to " + lcHost
- Endif
- Return .T.
- Return
- *** End of ftpPut.PRG ***********************************************************
- *: Where: lcHost = Host computer IP address or name
- *: lcUser = user name - anonymous may be used
- *: lcPassword = password
- *: lcSource = source file name (remote)
- *: lcTarget = target file name (local)
- *: lnXFerType = 1 (default) for ascii, 2 for binary
- *.................................................................................
- Declare Integer InternetOpen In wininet.Dll;
- STRING sAgent,;
- INTEGER lAccessType,;
- STRING sProxyName,;
- STRING sProxyBypass,;
- STRING lFlags
- Declare Integer InternetCloseHandle In wininet.Dll Integer hInet
- Declare Integer InternetConnect In wininet.Dll;
- INTEGER hInternetSession,;
- STRING lcHost,;
- INTEGER nServerPort,;
- STRING lcUser,;
- STRING lcPassword,;
- INTEGER lService,;
- INTEGER lFlags,;
- INTEGER lContext
- Declare Integer FtpPutFile In wininet.Dll;
- INTEGER hConnect,;
- STRING lpszLocalFile,;
- STRING lpszNewRemoteFile,;
- INTEGER dwFlags,;
- INTEGER dwContext
- Declare Integer FtpDeleteFile In wininet.Dll;
- INTEGER hConnect,;
- STRING lpszFileName
- Public hopen, hftpsession
- lchost = Alltrim(lchost)
- lcuser = Alltrim(lcuser)
- lcpassword = Alltrim(lcpassword)
- lcsource = Alltrim(lcsource)
- lctarget = Alltrim(lctarget)
- If connect2ftp (lchost, lcuser, lcpassword)
- ** Sukses sampai disini
- Wait Window 'Transferring File....' Nowait Nocle
- If ftpputfile(hftpsession, lcsource, lctarget, 1, 0) = 1
- Wait Window lcsource + ' File Transferred.' Nowait Nocle
- Else
- Wait Window lcsource + ' File NOT Transferred.' Nowait Nocle
- Endif
- = internetclosehandle (hftpsession)
- = internetclosehandle (hopen)
- Wait Clear
- Endif
- *..................... connect2ftp .........................................
- *... Makes sure there is actually a valid connection to the host
- Function connect2ftp (lchost, lcuser, lcpassword)
- * open access to Inet functions
- hopen = internetopen ("vfp", 1, 0, 0, 0)
- If hopen = 0
- Return .F.
- Endif
- *... The first '0' says use the default port, usually 21.
- hftpsession = internetconnect (hopen, lchost,;
- 0, lcuser, lcpassword, 1, 0, 0) &&... 1 = ftp protocol
- If hftpsession = 0
- * close access to Inet functions and exit
- = internetclosehandle (hopen)
- *!* ? "ftp " + lcHost + " is not available"
- Return .F.
- Else
- *!* ? "Connected to " + lcHost
- Endif
- Return .T.
- Return
- *** End of ftpPut.PRG ***********************************************************
- *: lcUser = user name - anonymous may be used
- *: lcPassword = password
- *: lcSource = source file name (remote)
- *: lcTarget = target file name (local)
- *: lnXFerType = 1 (default) for ascii, 2 for binary
- *.................................................................................
- Declare Integer InternetOpen In wininet.Dll;
- STRING sAgent,;
- INTEGER lAccessType,;
- STRING sProxyName,;
- STRING sProxyBypass,;
- STRING lFlags
- Declare Integer InternetCloseHandle In wininet.Dll Integer hInet
- Declare Integer InternetConnect In wininet.Dll;
- INTEGER hInternetSession,;
- STRING lcHost,;
- INTEGER nServerPort,;
- STRING lcUser,;
- STRING lcPassword,;
- INTEGER lService,;
- INTEGER lFlags,;
- INTEGER lContext
- Declare Integer FtpPutFile In wininet.Dll;
- INTEGER hConnect,;
- STRING lpszLocalFile,;
- STRING lpszNewRemoteFile,;
- INTEGER dwFlags,;
- INTEGER dwContext
- Declare Integer FtpDeleteFile In wininet.Dll;
- INTEGER hConnect,;
- STRING lpszFileName
- Public hopen, hftpsession
- lchost = Alltrim(lchost)
- lcuser = Alltrim(lcuser)
- lcpassword = Alltrim(lcpassword)
- lcsource = Alltrim(lcsource)
- lctarget = Alltrim(lctarget)
- If connect2ftp (lchost, lcuser, lcpassword)
- ** Sukses sampai disini
- Wait Window 'Transferring File....' Nowait Nocle
- If ftpputfile(hftpsession, lcsource, lctarget, 1, 0) = 1
- Wait Window lcsource + ' File Transferred.' Nowait Nocle
- Else
- Wait Window lcsource + ' File NOT Transferred.' Nowait Nocle
- Endif
- = internetclosehandle (hftpsession)
- = internetclosehandle (hopen)
- Wait Clear
- Endif
- *..................... connect2ftp .........................................
- *... Makes sure there is actually a valid connection to the host
- Function connect2ftp (lchost, lcuser, lcpassword)
- * open access to Inet functions
- hopen = internetopen ("vfp", 1, 0, 0, 0)
- If hopen = 0
- Return .F.
- Endif
- *... The first '0' says use the default port, usually 21.
- hftpsession = internetconnect (hopen, lchost,;
- 0, lcuser, lcpassword, 1, 0, 0) &&... 1 = ftp protocol
- If hftpsession = 0
- * close access to Inet functions and exit
- = internetclosehandle (hopen)
- *!* ? "ftp " + lcHost + " is not available"
- Return .F.
- Else
- *!* ? "Connected to " + lcHost
- Endif
- Return .T.
- Return
- *** End of ftpPut.PRG ***********************************************************
- *: lcPassword = password
- *: lcSource = source file name (remote)
- *: lcTarget = target file name (local)
- *: lnXFerType = 1 (default) for ascii, 2 for binary
- *.................................................................................
- Declare Integer InternetOpen In wininet.Dll;
- STRING sAgent,;
- INTEGER lAccessType,;
- STRING sProxyName,;
- STRING sProxyBypass,;
- STRING lFlags
- Declare Integer InternetCloseHandle In wininet.Dll Integer hInet
- Declare Integer InternetConnect In wininet.Dll;
- INTEGER hInternetSession,;
- STRING lcHost,;
- INTEGER nServerPort,;
- STRING lcUser,;
- STRING lcPassword,;
- INTEGER lService,;
- INTEGER lFlags,;
- INTEGER lContext
- Declare Integer FtpPutFile In wininet.Dll;
- INTEGER hConnect,;
- STRING lpszLocalFile,;
- STRING lpszNewRemoteFile,;
- INTEGER dwFlags,;
- INTEGER dwContext
- Declare Integer FtpDeleteFile In wininet.Dll;
- INTEGER hConnect,;
- STRING lpszFileName
- Public hopen, hftpsession
- lchost = Alltrim(lchost)
- lcuser = Alltrim(lcuser)
- lcpassword = Alltrim(lcpassword)
- lcsource = Alltrim(lcsource)
- lctarget = Alltrim(lctarget)
- If connect2ftp (lchost, lcuser, lcpassword)
- ** Sukses sampai disini
- Wait Window 'Transferring File....' Nowait Nocle
- If ftpputfile(hftpsession, lcsource, lctarget, 1, 0) = 1
- Wait Window lcsource + ' File Transferred.' Nowait Nocle
- Else
- Wait Window lcsource + ' File NOT Transferred.' Nowait Nocle
- Endif
- = internetclosehandle (hftpsession)
- = internetclosehandle (hopen)
- Wait Clear
- Endif
- *..................... connect2ftp .........................................
- *... Makes sure there is actually a valid connection to the host
- Function connect2ftp (lchost, lcuser, lcpassword)
- * open access to Inet functions
- hopen = internetopen ("vfp", 1, 0, 0, 0)
- If hopen = 0
- Return .F.
- Endif
- *... The first '0' says use the default port, usually 21.
- hftpsession = internetconnect (hopen, lchost,;
- 0, lcuser, lcpassword, 1, 0, 0) &&... 1 = ftp protocol
- If hftpsession = 0
- * close access to Inet functions and exit
- = internetclosehandle (hopen)
- *!* ? "ftp " + lcHost + " is not available"
- Return .F.
- Else
- *!* ? "Connected to " + lcHost
- Endif
- Return .T.
- Return
- *** End of ftpPut.PRG ***********************************************************
- *: lcSource = source file name (remote)
- *: lcTarget = target file name (local)
- *: lnXFerType = 1 (default) for ascii, 2 for binary
- *.................................................................................
- Declare Integer InternetOpen In wininet.Dll;
- STRING sAgent,;
- INTEGER lAccessType,;
- STRING sProxyName,;
- STRING sProxyBypass,;
- STRING lFlags
- Declare Integer InternetCloseHandle In wininet.Dll Integer hInet
- Declare Integer InternetConnect In wininet.Dll;
- INTEGER hInternetSession,;
- STRING lcHost,;
- INTEGER nServerPort,;
- STRING lcUser,;
- STRING lcPassword,;
- INTEGER lService,;
- INTEGER lFlags,;
- INTEGER lContext
- Declare Integer FtpPutFile In wininet.Dll;
- INTEGER hConnect,;
- STRING lpszLocalFile,;
- STRING lpszNewRemoteFile,;
- INTEGER dwFlags,;
- INTEGER dwContext
- Declare Integer FtpDeleteFile In wininet.Dll;
- INTEGER hConnect,;
- STRING lpszFileName
- Public hopen, hftpsession
- lchost = Alltrim(lchost)
- lcuser = Alltrim(lcuser)
- lcpassword = Alltrim(lcpassword)
- lcsource = Alltrim(lcsource)
- lctarget = Alltrim(lctarget)
- If connect2ftp (lchost, lcuser, lcpassword)
- ** Sukses sampai disini
- Wait Window 'Transferring File....' Nowait Nocle
- If ftpputfile(hftpsession, lcsource, lctarget, 1, 0) = 1
- Wait Window lcsource + ' File Transferred.' Nowait Nocle
- Else
- Wait Window lcsource + ' File NOT Transferred.' Nowait Nocle
- Endif
- = internetclosehandle (hftpsession)
- = internetclosehandle (hopen)
- Wait Clear
- Endif
- *..................... connect2ftp .........................................
- *... Makes sure there is actually a valid connection to the host
- Function connect2ftp (lchost, lcuser, lcpassword)
- * open access to Inet functions
- hopen = internetopen ("vfp", 1, 0, 0, 0)
- If hopen = 0
- Return .F.
- Endif
- *... The first '0' says use the default port, usually 21.
- hftpsession = internetconnect (hopen, lchost,;
- 0, lcuser, lcpassword, 1, 0, 0) &&... 1 = ftp protocol
- If hftpsession = 0
- * close access to Inet functions and exit
- = internetclosehandle (hopen)
- *!* ? "ftp " + lcHost + " is not available"
- Return .F.
- Else
- *!* ? "Connected to " + lcHost
- Endif
- Return .T.
- Return
- *** End of ftpPut.PRG ***********************************************************
- *: lcTarget = target file name (local)
- *: lnXFerType = 1 (default) for ascii, 2 for binary
- *.................................................................................
- Declare Integer InternetOpen In wininet.Dll;
- STRING sAgent,;
- INTEGER lAccessType,;
- STRING sProxyName,;
- STRING sProxyBypass,;
- STRING lFlags
- Declare Integer InternetCloseHandle In wininet.Dll Integer hInet
- Declare Integer InternetConnect In wininet.Dll;
- INTEGER hInternetSession,;
- STRING lcHost,;
- INTEGER nServerPort,;
- STRING lcUser,;
- STRING lcPassword,;
- INTEGER lService,;
- INTEGER lFlags,;
- INTEGER lContext
- Declare Integer FtpPutFile In wininet.Dll;
- INTEGER hConnect,;
- STRING lpszLocalFile,;
- STRING lpszNewRemoteFile,;
- INTEGER dwFlags,;
- INTEGER dwContext
- Declare Integer FtpDeleteFile In wininet.Dll;
- INTEGER hConnect,;
- STRING lpszFileName
- Public hopen, hftpsession
- lchost = Alltrim(lchost)
- lcuser = Alltrim(lcuser)
- lcpassword = Alltrim(lcpassword)
- lcsource = Alltrim(lcsource)
- lctarget = Alltrim(lctarget)
- If connect2ftp (lchost, lcuser, lcpassword)
- ** Sukses sampai disini
- Wait Window 'Transferring File....' Nowait Nocle
- If ftpputfile(hftpsession, lcsource, lctarget, 1, 0) = 1
- Wait Window lcsource + ' File Transferred.' Nowait Nocle
- Else
- Wait Window lcsource + ' File NOT Transferred.' Nowait Nocle
- Endif
- = internetclosehandle (hftpsession)
- = internetclosehandle (hopen)
- Wait Clear
- Endif
- *..................... connect2ftp .........................................
- *... Makes sure there is actually a valid connection to the host
- Function connect2ftp (lchost, lcuser, lcpassword)
- * open access to Inet functions
- hopen = internetopen ("vfp", 1, 0, 0, 0)
- If hopen = 0
- Return .F.
- Endif
- *... The first '0' says use the default port, usually 21.
- hftpsession = internetconnect (hopen, lchost,;
- 0, lcuser, lcpassword, 1, 0, 0) &&... 1 = ftp protocol
- If hftpsession = 0
- * close access to Inet functions and exit
- = internetclosehandle (hopen)
- *!* ? "ftp " + lcHost + " is not available"
- Return .F.
- Else
- *!* ? "Connected to " + lcHost
- Endif
- Return .T.
- Return
- *** End of ftpPut.PRG ***********************************************************
- *: lnXFerType = 1 (default) for ascii, 2 for binary
- *.................................................................................
- Declare Integer InternetOpen In wininet.Dll;
- STRING sAgent,;
- INTEGER lAccessType,;
- STRING sProxyName,;
- STRING sProxyBypass,;
- STRING lFlags
- Declare Integer InternetCloseHandle In wininet.Dll Integer hInet
- Declare Integer InternetConnect In wininet.Dll;
- INTEGER hInternetSession,;
- STRING lcHost,;
- INTEGER nServerPort,;
- STRING lcUser,;
- STRING lcPassword,;
- INTEGER lService,;
- INTEGER lFlags,;
- INTEGER lContext
- Declare Integer FtpPutFile In wininet.Dll;
- INTEGER hConnect,;
- STRING lpszLocalFile,;
- STRING lpszNewRemoteFile,;
- INTEGER dwFlags,;
- INTEGER dwContext
- Declare Integer FtpDeleteFile In wininet.Dll;
- INTEGER hConnect,;
- STRING lpszFileName
- Public hopen, hftpsession
- lchost = Alltrim(lchost)
- lcuser = Alltrim(lcuser)
- lcpassword = Alltrim(lcpassword)
- lcsource = Alltrim(lcsource)
- lctarget = Alltrim(lctarget)
- If connect2ftp (lchost, lcuser, lcpassword)
- ** Sukses sampai disini
- Wait Window 'Transferring File....' Nowait Nocle
- If ftpputfile(hftpsession, lcsource, lctarget, 1, 0) = 1
- Wait Window lcsource + ' File Transferred.' Nowait Nocle
- Else
- Wait Window lcsource + ' File NOT Transferred.' Nowait Nocle
- Endif
- = internetclosehandle (hftpsession)
- = internetclosehandle (hopen)
- Wait Clear
- Endif
- *..................... connect2ftp .........................................
- *... Makes sure there is actually a valid connection to the host
- Function connect2ftp (lchost, lcuser, lcpassword)
- * open access to Inet functions
- hopen = internetopen ("vfp", 1, 0, 0, 0)
- If hopen = 0
- Return .F.
- Endif
- *... The first '0' says use the default port, usually 21.
- hftpsession = internetconnect (hopen, lchost,;
- 0, lcuser, lcpassword, 1, 0, 0) &&... 1 = ftp protocol
- If hftpsession = 0
- * close access to Inet functions and exit
- = internetclosehandle (hopen)
- *!* ? "ftp " + lcHost + " is not available"
- Return .F.
- Else
- *!* ? "Connected to " + lcHost
- Endif
- Return .T.
- Return
- *** End of ftpPut.PRG ***********************************************************
- *.................................................................................
- Declare Integer InternetOpen In wininet.Dll;
- STRING sAgent,;
- INTEGER lAccessType,;
- STRING sProxyName,;
- STRING sProxyBypass,;
- STRING lFlags
- Declare Integer InternetCloseHandle In wininet.Dll Integer hInet
- Declare Integer InternetConnect In wininet.Dll;
- INTEGER hInternetSession,;
- STRING lcHost,;
- INTEGER nServerPort,;
- STRING lcUser,;
- STRING lcPassword,;
- INTEGER lService,;
- INTEGER lFlags,;
- INTEGER lContext
- Declare Integer FtpPutFile In wininet.Dll;
- INTEGER hConnect,;
- STRING lpszLocalFile,;
- STRING lpszNewRemoteFile,;
- INTEGER dwFlags,;
- INTEGER dwContext
- Declare Integer FtpDeleteFile In wininet.Dll;
- INTEGER hConnect,;
- STRING lpszFileName
- Public hopen, hftpsession
- lchost = Alltrim(lchost)
- lcuser = Alltrim(lcuser)
- lcpassword = Alltrim(lcpassword)
- lcsource = Alltrim(lcsource)
- lctarget = Alltrim(lctarget)
- If connect2ftp (lchost, lcuser, lcpassword)
- ** Sukses sampai disini
- Wait Window 'Transferring File....' Nowait Nocle
- If ftpputfile(hftpsession, lcsource, lctarget, 1, 0) = 1
- Wait Window lcsource + ' File Transferred.' Nowait Nocle
- Else
- Wait Window lcsource + ' File NOT Transferred.' Nowait Nocle
- Endif
- = internetclosehandle (hftpsession)
- = internetclosehandle (hopen)
- Wait Clear
- Endif
- *..................... connect2ftp .........................................
- *... Makes sure there is actually a valid connection to the host
- Function connect2ftp (lchost, lcuser, lcpassword)
- * open access to Inet functions
- hopen = internetopen ("vfp", 1, 0, 0, 0)
- If hopen = 0
- Return .F.
- Endif
- *... The first '0' says use the default port, usually 21.
- hftpsession = internetconnect (hopen, lchost,;
- 0, lcuser, lcpassword, 1, 0, 0) &&... 1 = ftp protocol
- If hftpsession = 0
- * close access to Inet functions and exit
- = internetclosehandle (hopen)
- *!* ? "ftp " + lcHost + " is not available"
- Return .F.
- Else
- *!* ? "Connected to " + lcHost
- Endif
- Return .T.
- Return
- *** End of ftpPut.PRG ***********************************************************
- *..................... connect2ftp .........................................
- *... Makes sure there is actually a valid connection to the host
- Function connect2ftp (lchost, lcuser, lcpassword)
- * open access to Inet functions
- hopen = internetopen ("vfp", 1, 0, 0, 0)
- If hopen = 0
- Return .F.
- Endif
- *... The first '0' says use the default port, usually 21.
- hftpsession = internetconnect (hopen, lchost,;
- 0, lcuser, lcpassword, 1, 0, 0) &&... 1 = ftp protocol
- If hftpsession = 0
- * close access to Inet functions and exit
- = internetclosehandle (hopen)
- *!* ? "ftp " + lcHost + " is not available"
- Return .F.
- Else
- *!* ? "Connected to " + lcHost
- Endif
- Return .T.
- Return
- *** End of ftpPut.PRG ***********************************************************
- *... Makes sure there is actually a valid connection to the host
- Function connect2ftp (lchost, lcuser, lcpassword)
- * open access to Inet functions
- hopen = internetopen ("vfp", 1, 0, 0, 0)
- If hopen = 0
- Return .F.
- Endif
- *... The first '0' says use the default port, usually 21.
- hftpsession = internetconnect (hopen, lchost,;
- 0, lcuser, lcpassword, 1, 0, 0) &&... 1 = ftp protocol
- If hftpsession = 0
- * close access to Inet functions and exit
- = internetclosehandle (hopen)
- *!* ? "ftp " + lcHost + " is not available"
- Return .F.
- Else
- *!* ? "Connected to " + lcHost
- Endif
- Return .T.
- Return
- *** End of ftpPut.PRG ***********************************************************
- * open access to Inet functions
- hopen = internetopen ("vfp", 1, 0, 0, 0)
- If hopen = 0
- Return .F.
- Endif
- *... The first '0' says use the default port, usually 21.
- hftpsession = internetconnect (hopen, lchost,;
- 0, lcuser, lcpassword, 1, 0, 0) &&... 1 = ftp protocol
- If hftpsession = 0
- * close access to Inet functions and exit
- = internetclosehandle (hopen)
- *!* ? "ftp " + lcHost + " is not available"
- Return .F.
- Else
- *!* ? "Connected to " + lcHost
- Endif
- Return .T.
- Return
- *** End of ftpPut.PRG ***********************************************************
- *... The first '0' says use the default port, usually 21.
- hftpsession = internetconnect (hopen, lchost,;
- 0, lcuser, lcpassword, 1, 0, 0) &&... 1 = ftp protocol
- If hftpsession = 0
- * close access to Inet functions and exit
- = internetclosehandle (hopen)
- *!* ? "ftp " + lcHost + " is not available"
- Return .F.
- Else
- *!* ? "Connected to " + lcHost
- Endif
- Return .T.
- Return
- *** End of ftpPut.PRG ***********************************************************
- *** End of ftpPut.PRG *************************************************************
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement