String file_data = client.ExecuteRedirect(HttpClient::DEFAULT_MAX_REDIRECT, HttpClient::DEFAULT_RETRIES,THISBACK(progress_indecator));
bool Download_Manager_Window::progress_indecator(int x, int all) { static float timer = 0; static float data = 0; static double counter = 0; double percentage; double temp1 = x, temp2 = all; if (all != 0) percentage = (temp1 / temp2) * 100.0; else percentage = 0; //label_DownloadDirectory.SetText(DblStr(percentage)); progress_bar.Set(percentage, 100); timer = clock() - timer; data = x - data; //System("File path") //int percantage = (x/all)*100.0; if (data != 0 && timer != 0 && DblInt(counter) % 10 == 0) { //label_File.SetText(IntStr(x / 1000) + " KBs out of " + IntStr(all / 1000) + " KB "); int temp = data / timer; String temps = IntStr(temp); temps += " KB/S"; label_DownloadSpeed.SetText(temps); } timer = clock(); data = x; counter++; if (x == all && counter > 10) { timer = 0; data = 0; counter = 0; return true; } else return false; }
Report message to a moderator