基本信息
源码名称:WEB方式管理FTP上传下载
源码大小:4.96KB
文件格式:.rar
开发语言:C#
更新时间:2020-05-22
   友情提示:(无需注册或充值,赞助后即可获取资源下载链接)

     嘿,亲!知识可是无价之宝呢,但咱这精心整理的资料也耗费了不少心血呀。小小地破费一下,绝对物超所值哦!如有下载和支付问题,请联系我们QQ(微信同号):78630559

本次赞助数额为: 5 元 
   源码介绍

c#实现ftp上传下载(源码)。这个可以简单达到目的。-c# to achieve ftp upload and download. This can be simple to achieve their goals.

<%@ WebHandler Language="C#" Class="ftpDownload" %>

using System;

using System.Web;

public class ftpDownload : IHttpHandler

{

    /// <summary>

    /// ftp协议下载文件

    /// </summary>

    /// <param name="context"></param>

    public void ProcessRequest(HttpContext context)

    {

        context.Response.ContentType = "text/plain";

        string ftpURI = context.Request.QueryString["ftpURI"];//ftpURI

        string fileName = context.Request.QueryString["fileName"];//fileName

        string localPath = "C:\\";//文件下载路径(可自定义)

        string errorMsg = "";

        bool b = FtpWeb.Download(ftpURI, localPath, fileName, out errorMsg);

        if (b)

        {

            context.Response.Write("ok");

        }

        else

        {

            context.Response.Write(errorMsg);

        }

    }

 

    public bool IsReusable

    {

        get

        {

            return false;

        }

    }

}