private void SetAllPictures(string link, string className1, Image picBox1, string className2, Image picBox2) { Thread.Sleep(1000); WebsiteSearch web = new WebsiteSearch(); // Get links string imageLink1 = web.GetPictureLink(link, className1); string imageLink2 = web.GetPictureLink(link, className2); thumbnailImage = GetPicture(imageLink1); fullImage = GetPicture(imageLink2); syncContext.Post(o => RefreshPictures(), null); }
private void SetPicture(string link, string className, Image picBox) { // This can go to WebsiteSearch web = new WebsiteSearch(); // Get Image link string imageLink = web.GetPictureLink(link, className); // Load images if they return a value Console.WriteLine(imageLink); if (imageLink != null) { picBox.Source = GetPicture(imageLink); } }
private void GetAllData() { WebsiteSearch webSearch = new WebsiteSearch(); // Loop through all permutations of searching for (int o = 0; o < webSearch.uploadDates.Length; o++) { for (int n = 0; n < 16; n++) { for (int m = 0; m < webSearch.difficulties.Length; m++) { for (int l = 0; l < webSearch.regions.Length; l++) { for (int k = 0; k < webSearch.courseThemes.Length; k++) { for (int j = 0; j < webSearch.gameStyles.Length; j++) { for (int i = 0; i < 10; i++) { List <MarioMakerLevel> tempLevels = new List <MarioMakerLevel>(); bool hasNull = false; foreach (var level in webSearch.GetLevels(i, j, k, l, m, n, o)) { //level.ID = marioMakerLevels.Count; level.ID = level.Link.Substring(level.Link.Length - 19); // Copy the last 19 characters (Result example 0000-0000-0000-0000) hasNull = checkHasNull(level); // Check if the level has a null value (This causes the data to be shifted) tempLevels.Add(level); // Add level to temp levelsChecked += 1; // Add one to levels checked } if (!hasNull) { marioMakerLevels.AddRange(tempLevels.Where(p => marioMakerLevels.Where(q => q.ID == p.ID).ToArray().Length == 0)); } searchValues = new int[] { i, j, k, l, m, n, o }; Thread.Sleep(1500); // Sleep for 1.5 seconds, if we do this too fast Nintendo will block access } } } } } } } }