Loop and PutFile - WeOnlyDo Discussion board

Loop and PutFile (General questions)

by segosambel, Wednesday, April 04, 2007, 13:06 (6444 days ago)

I have a problem about PutFile (C# Application)

example code
===============================
public void SendToFTPServer()
{
wodFtpDLXComClass wod = new wodFtpDLXComClass();
wod.Login = fConf.LoginFtp;
wod.Password = fConf.PwdFtp;
wod.Passive = true;
wod.StrictHost = true;
wod.Blocking = true;
wod.LicenseKey = XXXX-XXX-XXXX-XXXX ; // ===> Hide

try
{
switch (fConf.Protocol.ToLower())
{
case ftp :
wod.Connect(fConf.Host, fConf.Port, ProtocolsEnum.FTP);
break;
case ftpsimplicit :
wod.Connect(fConf.Host, fConf.Port, ProtocolsEnum.FTPSimplicit);
break;
default:
return;
}

for(i=1;i<=2;i++)
{
try
{
wod.PutFile( D:\ftp\ftp\bin\Debug\setting\example.txt , / +i.toString());
}
catch(Exception e)
{
MessageBox.Show(e.Message);
}
}

try
{
wod.Disconnect(null);
}
catch
{
throw new Exception();
}
}
catch
{
throw new Exception();
}
}


result, just first file or one result file transfered is /1 (example.txt on server), but the second file
fail transfered /2 . error Requested Action Not Taken, File Unavailable(e.g., file not found, no access)

How about it?? thankz a lot.......


Complete thread:

 

  • Loop and PutFile - segosambel, 2007-04-04, 13:06 [*]