Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
FTP Service Class
Message
De
04/04/2002 13:28:17
Mike Smith
Doncaster Office Services
Oakville, Ontario, Canada
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00640200
Message ID:
00641003
Vues:
96
Nadia:

I am still stuck on first base.

The code below generates the error "No Connection Made".

First I log onto my ISP so there is a conenction to the internet. I have also browsed to the site "ftp://doncasteroffice.net/rentmast/update/" to see the files there.

But when I run the code below, I get no connection. I have also tried to make a connection with this code to "ftp://west-wind.com/updates" which is an anonomyous site but again I get the "No Connection" error.

I am using IE Ver 5.5. I have tried the code under Win 98 and Win NT 4.0 without success.

Have you got some sample code that would connect me to an anonymous site so I can check for punctuation etc.?

Thanks.

Mike Smith
**************

lparameter cUserId,cPassword,cFtpAddr,cTheFile,cFtpFile,cFtpPath, tlSilentMode
if vartype(m.sz_ftp)#'O'
sz_ftp = newobject('ftp_service',"ftp.prg")
endif

local lcReturn, lcSetSafety, s
lcReturn=".T."

lcSetSafety = set('safety')
set safety off
m.FtpPath = ""
m.cUserId = "michaels"
m.cPassword = "michaels123"
m.cFtpAddr = "ftp://doncasteroffice.net/rentmast/update/"

if sz_ftp.OpenInternet(m.cUserId,m.cPassword, m.cFtpAddr, "21")
if !empty(m.cFtpPath)
if !sz_ftp.ChangeFtpDirectory(m.cFtpPath)
s=sz_ftp.GetErrorCode(.t.)
lcReturn=".F.Can not change directory" && Set to false if - Will use this as a check as to whether
endif
endif
m.cFtpFile = "ftp://www.doncasteroffice.net/rentmast/update/testfile.txt"
m.cTheFile = "C:\TEMPRENT\TESTFILE.txt"
if m.lcReturn =".T."
if !sz_ftp.PutFtpFile(m.cFtpFile, m.cTheFile)
lcReturn=".F.Can not put file "+ m.cFtpFile+" on the FTP Site"
else
lcReturn = ".T."
endif
endif
sz_ftp.CloseInternet()
else
if not m.tlSilentMode
=messagebox("No Connection Made", 64, "FTP Message")
endif
sz_ftp.CloseInternet()
lcReturn=".F.No Connection Made"
endif

release sz_ftp
return m.lcReturn
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform