public void DownloadFile(String Url, String FileName) { for (int RetryCount = 1; true; RetryCount++) { try { HttpClient httpClient = new HttpClient(); httpClient.DownloadFile(Url, FileName); return; } catch (Exception ex) { if (RetryCount == MaxRetryCount) { throw ex; } } } }
public void DownloadFile(String Url, String FileName) { for (int RetryCount = 1 ; true ; RetryCount++) { try { HttpClient httpClient = new HttpClient(); httpClient.DownloadFile(Url, FileName); return; } catch (Exception ex) { if (RetryCount == MaxRetryCount) throw ex; } } }
public void DownloadFile(String FileName) { httpClient.DownloadFile(Url, FileName); }