FtpWebResponse response = (FtpWebResponse)request.GetResponse(); Stream responseStream = response.GetResponseStream(); byte[] buffer = new byte[2048]; FileStream filestreaming = new FileStream(installation_dir + filename, FileMode.Create); int ReadCount = responseStream.Read(buffer, 0, buffer.Length); percentComplete = 0; while (ReadCount > 0) { filestreaming.Write(buffer, 0, ReadCount); ReadCount = responseStream.Read(buffer, 0, buffer.Length); percentComplete = (int)Math.Round((double)(100 * (filestreaming.Length)) / size); } response.Close(); filestreaming.Close(); responseStream.Close();
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)