string name = (i+1) + url.Substring(url.LastIndexOf('.')); string filePath = @"d:\Downloads\" + name; try { using (WebClient client = new WebClient()) { client.DownloadFile(url, filePath); } } catch (Exception ex) { }