using (System.IO.StreamWriter SW = new System.IO.StreamWriter(Server.MapPath("save/information/Data_" + strDate + ".csv"))){ SW.WriteLine(s.FirstName + ";" + s.LastName + ";" + s.Address1 + ";"); SW.Close();}
StreamWriter SW = new StreamWriter(@"\\111.222.1.00\c$\Inetpub\wwwroot\site_toto\ save\information\Data_" + strDate + ".csv");
using (FTP ftplib = new FTP(MapPath ("Data_" + strDate + ".csv")));try { ftplib.Connect("ftp.toto.com", "tata", "pata"); ftplib.ChangeDir("information/");}catch(Exception ex){ Console.WriteLine(s.FirstName + ";" + s.LastName + ";" + s.Address1 + ";");}try{ int perc = 0; ftplib.OpenDownload("Data_" + strDate + ".csv", true); while(ftplib.DoDownload() > 0) { perc = (int)((ftplib.BytesTotal * 100) / ftplib.FileSize); Console.Write("\rDownloading: {0}/{1} {2}%", ftplib.BytesTotal, ftplib.FileSize, perc); Console.Out.Flush(); } Console.WriteLine("");}catch(Exception ex) { Console.WriteLine(""); Console.WriteLine(ex.Message);}
using ftplib;