예제 #1
0
        /// <summary>
        /// 获取当前目录下明细(包含文件和文件夹)
        /// </summary>
        /// <returns></returns>
        public string[] GetFilesDetailList(string local)
        {
            try
            {
                var list   = new List <string>();
                var client = new EACT.FTPClient(ftpConnection.ServerAddress, local, ftpConnection.UserName, ftpConnection.Password, ftpConnection.ServerPort);
                client.Connect();
                if (client.Connected)
                {
                    list = client.List(string.Empty).ToList();
                    client.DisConnect();
                }

                return(list.ToArray());
            }
            catch
            {
                return(new string[] { });
            }
        }
예제 #2
0
 public FtpClientEx(string FtpServerIP, int FtpServerPort, string FtpRemotePath, string FtpUser, string FtpPassword)
 {
     ftpConnection = new EACT.FTPClient(FtpServerIP, FtpRemotePath, FtpUser, FtpPassword, FtpServerPort);
     ftpConnection.Connect();
 }