So I have my FTP program working great with static file names for the download and upload portions. Now management has asked that the program be able to rename the downloaded file and append the date to the file in MMdd format and then up load that file to the ftp server.
I think I have the code correct for the renaming part of the process here
//Generate name for download file
string filePath = @"c:\";
string fileName = Path.Combine(filePath,string.Format("PMP{MMdd}.txt", DateTime.Now));
My question is how do I pass that variable over to the upload portion of the program.
This is how I have the class defined
public void upload(string remoteFile, string localFile)
And this is how I’m passing the static file names over to the class
/* Upload a File */
UploadftpClient.upload("testup.txt", @"c:\testup.txt");
I built the program using the code found here http://www.codeproject.com/Tips/443588/Simple-Csharp-FTP-Class
Programming isn’t my strong suit and I’m stumped as to how to accomplish what I need to do here.
Is this what you’re looking for?
EDIT: The following line should replace the one you are using