Ранее я пользовался обычным методом
Код:
public Form1()
{
this.InitializeComponent();
var source = new AutoCompleteStringCollection();
source.AddRange(new string[]
{
"121 gigawatts",
"4815162342",
"8th chevron",
"How many days in a leap year",
"Im Gummies",
"Im not a robot",
"a wild captcha appeans",
"abelian grape",
"abide with me",
"abracadabra",
"across the board",
"adapt improve",
"all singing",
"am i happy",
"are we there yet",
"are you a human",
"are you ready",
"are you the keymaster",
"army training sir",
"army training",
"around here",
"ask questions",
"atr you ready",
"back to basics",
"back track",
"background noise",
"bacon and eggs",
"bad books",
"bait the line",
"baked in a pie",
"ball of confusion",
"banana split",
"barking mad",
"bath towel",
"bath water",
"be careful",
"be mine",
"be serious now",
"beautiful friendship",
"bee line",
"beek ends",
"been there",
"beer in a bottle",
"bees knees",
"believe me",
"best seller",
"better call saul",
"better half",
"better next time",
"yellow belly",
"you first",
"you have my stapler",
"you the man",
"zombie attack",
"zone stone"
});
textBox2.AutoCompleteCustomSource = source;
textBox2.AutoCompleteMode = AutoCompleteMode.Append;
textBox2.AutoCompleteSource = AutoCompleteSource.CustomSource;
}
private void button9_Click(object sender, EventArgs e)
{
this.textBox2.Focus();
this.locker = true;
this.label12.Text = "";
this.panel2.Visible = false;
countEntered++;
timer1.Start();
string iAnswer = this.textBox2.Text;
this.textBox2.Text = "";
this.pictureBox1.Image = null;
using (StreamWriter writer = File.AppendText("CAPTCHAS/NORMAL/list.txt"))
{
writer.WriteLine(string.Concat(new object[] { "|", iAnswer, "|", "," }));
}
this.SendAnsw = new Thread(() => this.sendAnswer(this.captchaThread, iAnswer));
this.SendAnsw.Priority = ThreadPriority.Highest;
this.SendAnsw.Start();
}
Через textbox сохраняя некоторые подобные фразы в текстовом фаиле, после их переносил оттуда в этот код, внутрь программы, но.....хочется двигаться дальше, работать более продуктивно, экономить время более не заполняя этот список этим перетаскиванием. Как можно сделать что-то, подобное, посредством сохранения введеного в textbox в некую базу данных, после чего введеное потом само уже без вмешательство в код программы, выводилось при вбивании в textbox??????????