.NET中完成FTP各功能操作

1.FTP工厂类
using System;
using System.Configuration;
using System.IO;
using System.Net;
using System.Net.Sockets;
using System.Text;
using System.Threading;

namespace School.Common
{
    
/// <summary>
    
/// 类 编 号: 0043
    
/// 类 名 称: FTPFactory 
    
/// 内容摘要: FTP工厂,完成FTP各功能操作
    
/// 完成日期: 2007-1-12 10:38:36
    
/// 编码作者: 林付国
    
/// </summary>

    public class FTPFactory
    
{
        
成员变量

        
构造方法

        
基本信息设置

        
属性

        
功能操作

        
信息输出方法
    }

}

2.调用方法
 // 检查此FTP是否可用
                    FTPFactory ftp = new FTPFactory();
                    ftp.setRemoteHost(主机名);
                    ftp.setRemoteUser(用户名);
                    ftp.setRemotePass(密码);
                    ftp.setRemotePort(端口);
                    ftp.setRemotePath(路径);

                    ftp.login();

                    if (!ftp.GetLogin)
                    {
              // 提示连接失败
                        this.Cursor = Cursors.Default;
                        return;
                    }
                    ftp.close();
原文地址:https://www.cnblogs.com/linfuguo/p/716828.html