знаю многопоток, очередь акков и прокси, но ввывод инфы(String) при многопотоке мешается, и ввыводит иногда не то что нужно
Code: private void bruteUI() { //Setup the password array string[] passwordArray = new string[max]; //Setup the Character arrays string[] lower = { "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z" }; string[] upper = { "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z" }; string[] digits = { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9" }; characterArray.AddRange(lower); characterArray.AddRange(upper); characterArray.AddRange(digits); for (i = 0; i < max; i++) { passwordArray[i] = "-1"; } //Get the amount of characters numVals = characterArray.Count; //Calculate the total possible characters total = Math.Pow(numVals, max); //Get the real maximum for (i = 0; i < max + 1; i++) { realMax = realMax + characterArray[Convert.ToInt32(numVals - 1)]; } //Start setting the pw string for (i = 0; i < min; i++) { passwordArray[i] = characterArray[0].ToString(); } //Add the starts with value. startsWith = txtStartsWith.Text; if (startsWith != string.Empty) { for (int y = 0; y < startsWith.Length; y++) { passwordArray[y] = startsWith.Substring(y, 1); } } i = 0; //Set the First Value while (passwordArray[i] != "-1" && cancelWorker == false) { firstVal += passwordArray[i]; i++; current++; //label1.Text = current + " of " + total; Application.DoEvents(); } testPW = firstVal; updatePassword(); while (true && cancelWorker == false) { for (i = 0; i < (max + 1); i++) { if (passwordArray[i] == "-1") { break; } } i--; incDone = false; while (!incDone) { for (j = 0; j < numVals; j++) { if (passwordArray[i] == characterArray[j].ToString()) { break; } } if (j == (numVals - 1)) { passwordArray[i] = characterArray[0].ToString(); //label2.Text = passwordString(); current++; label4.Text = current + " of " + total; i--; if (i < 0) { for (i = 0; i < (max + 1); i++) { if (passwordArray[i] == "-1") { break; } } passwordArray[i] = characterArray[0].ToString(); passwordArray[i + 1] = "-1"; //label2.Text = passwordString(); current++; //label1.Text = current + " of " + total; Application.DoEvents(); incDone = true; } } else { passwordArray[i] = characterArray[j + 1].ToString(); //label2.Text = passwordString(); current++; //label1.Text = current + " of " + total; Application.DoEvents(); incDone = true; } } } i = 0; currentVal = ""; while (passwordArray[i] != "-1") { currentVal = currentVal + passwordArray[i]; i++; testPW = currentVal; //label2.Text = passwordString(); Application.DoEvents(); if (currentVal == realMax) { break; } } } private string passwordString() { string tmppw = ""; for (int x = 0; x < max; x++) { tmppw += passwordArray[x]; } return tmppw.Replace("-1", "") ; }