# FTP를 통한 파일 다운로드 예제

2021. 1. 24. 12:28개발/C#

 

 

using System.Net;

namespace FTPDownLoad

{

  class Program

  {

    static void Main(string[] args)

    {

      string start = "ftp://speedtest.tele2.net/1KB.zip"; // 다운 받을 파일명

      string end = "1kb.zip";                             // 다운 받은 파일명

      string user = "aa";

      string pwd = "bb";

      using(WebClient client = new WebClient())

      {

        client.Credentials = new NetworkCredential(user, pwd);

        client.DownloadFile(start, end);

      }

    }

  }

}