如何在 C# 中将RichTextBox1
' 值扔给 a ?BackgroundWorker
public void button4_Click(object sender, EventArgs e)
{
if (String.IsNullOrEmpty(richTextBox1.Text.Trim())){
MessageBox.Show("No value in RichTextBox?");
return;
}
if (backgroundWorker1.IsBusy != true)
{
// Start the asynchronous operation.
backgroundWorker1.RunWorkerAsync(richTextBox1);
}
这是我BackgroundWorker
的代码:
public void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e) {
HtmlAgilityPack.HtmlDocument document = new HtmlAgilityPack.HtmlDocument();
foreach (string vr in richTextBox1.Lines)
{
⋮
}
}