private void SaveArtistPhoto(Artist artist, ArtistPage artistPage) { for (int i = 0; i < artistPage.ArtistPhotos.Count; i++) { Image img = Image.FromStream(HtmlRequestHelper.GetStream(artistPage.ArtistPhotos[i], artistPage.ArtistPhotos[i])); img.Save(@"D:\Project\MvcRockShop\Artist\" + artist.Id + "_" + i + ".jpg", System.Drawing.Imaging.ImageFormat.Jpeg); img.Dispose(); } }
private void SaveCover(List <AlbumPage> albumPages, List <Album> albums) { for (int i = 0; i < albumPages.Count; i++) { if (!String.IsNullOrEmpty(albumPages[i].CoverImg)) { Image img = Image.FromStream(HtmlRequestHelper.GetStream(albumPages[i].CoverImg, albumPages[i].CoverImg)); img.Save(@"D:\Project\MvcRockShop\Album\" + albums[i].Id + ".jpg", System.Drawing.Imaging.ImageFormat.Jpeg); img.Dispose(); } } }