Hi Bruce/Hans,
I am back again and again I want help from you people. Everything is working fine with your latest free version. But while FTPing to the UNIX server, I am getting the following error:
Please logout before sending new USER command. (code=503)
The error is coming while trying to login( ftpConn.Login();). But it works fine from command prompt. Please help me to resolve this.
Please have a look at my code here:
private string FTPFile(string strFileFullName, string strToFileName, string strFolderName, string strServerName, string strFTPID, string strPwd, string strActive_YN, string strSiteCommand)
{
string strReturnVal = "";
EnterpriseDT.Net.Ftp.FTPConnection ftpConn = new EnterpriseDT.Net.Ftp.FTPConnection();
try
{
ftpConn.ServerAddress = strServerName;
ftpConn.UserName = strFTPID;
ftpConn.Password = strPwd;
if (strActive_YN == "Y")
{
ftpConn.ConnectMode = EnterpriseDT.Net.Ftp.FTPConnectMode.ACTIVE;
}
else
{
ftpConn.ConnectMode = EnterpriseDT.Net.Ftp.FTPConnectMode.PASV;
}
ftpConn.TransferType = EnterpriseDT.Net.Ftp.FTPTransferType.ASCII;
ftpConn.Connect();
ftpConn.Login();
ftpConn.ChangeWorkingDirectory(strFolderName);
if (strSiteCommand.Length > 0)
{
ftpConn.InvokeSiteCommand(strSiteCommand);
}
ftpConn.UploadFile(strFileFullName, strToFileName);
ftpConn.Close();
}
catch (Exception ex)
{
strReturnVal = ex.Message;
log4.Error("Error while FTPing. File Name: " + strFileFullName + "Error Details: " + ex.Message);
}
return strReturnVal;
}
Awaiting fro your reply....
THANKS & REGARDS,
Lita