how to download ftp files from checkedlisbox in c# window forms

  • Thread starter Thread starter Jazz17
  • Start date Start date
J

Jazz17

Guest
i am able to display file names from ftp server to checkedlist box

now i want to download those files that are checked in checkedlistbox to a particular location

private void button3_Click(object sender, EventArgs e)
{


FtpWebRequest request = (FtpWebRequest)WebRequest.Create("ftp://192.168.10.11");
request.Credentials = new NetworkCredential("ftp-user", "123");
request.Method = WebRequestMethods.Ftp.ListDirectory;

StreamReader streamReader = new StreamReader(request.GetResponse().GetResponseStream());

string fileName = streamReader.ReadLine();

while (fileName != null)
{




if(fileName!=null)
checkedListBox1.Items.Add(fileName).ToString();
fileName = streamReader.ReadLine();

}

request = null;
streamReader = null;
}
}

i dont know how to download the files that are checked in checkedlistbox

Continue reading...
 
Back
Top