Example #1
0
 public FTPClient(FTPPath FTP_FOLDER, string FTP_User, string FTP_Pwd)
 {
     FTP_FOLDER  = ((string)FTP_FOLDER).TrimEnd('/', '\\');
     FTP_FOLDER += "/";
     FTP_FOLDER  = FTPPath.TrimStart(FTP_FOLDER, "ftp://", "ftp.");
     MAINFOLDER  = "ftp://ftp." + FTP_FOLDER;
     User        = FTP_User;
     Pwd         = FTP_Pwd;
 }
Example #2
0
        private FtpWebRequest GetRequest(string method, string folder = "")
        {
            folder = FTPPath.TrimStart(folder, MAINFOLDER);

            FtpWebRequest request = (FtpWebRequest)WebRequest.Create(Validator.CombineURL(MAINFOLDER, folder));

            request.Credentials = NETCREDENTIAL;

            request.Method = method;

            return(request);
        }