2.> I created another folder(BackupDirTest) using given code below.
PowerShell
private static void CreateFTPDir()
{
FtpWebRequest request = (FtpWebRequest)FtpWebRequest.Create("ftp://FTPServerIP/" + "
BackupDirTest");
request.Credentials = new NetworkCredential("anonymous", "anonymous");
request.UsePassive = true;
request.UseBinary = true;
request.KeepAlive = false;
//Console.WriteLine("Getting the response");
request.Method = WebRequestMethods.Ftp.MakeDirectory;
using (var resp = (FtpWebResponse)request.GetResponse())
{
//Console.WriteLine(resp.StatusCode);
FTPdestinationPath = resp.ResponseUri.ToString();
}
}
3.> How to shared this(BackupDirTest) folder using c# code, so that I can get shared path. And I can use below code for moving file from 1 folder to another folder.
File.Move(FTPsourcePath, FTPdestinationPath +"\\"+ FileName);Because this "Move" function is working in local compute but its not working on FTP Server Why?
Answers
Know the answer? Post it. Somebody with the same question will find it here.