private void bwSearcher_DoWork(object sender, DoWorkEventArgs e) { String[] alIn = (String[])e.Argument; foreach (String fp in alIn) { SP2Infection t = new SP2Infection(); if (Directory.Exists(fp)) { foreach (String fpAny in Directory.GetFiles(fp, "*", SearchOption.AllDirectories)) { if (String.Compare(".dll", Path.GetExtension(fpAny), true) == 0 || String.Compare(".exe", Path.GetExtension(fpAny), true) == 0) { Updatel(fpAny); t.Test(fpAny); } } } else if (File.Exists(fp)) { Updatel(fp); t.Test(fp); } Sync.Send(delegate(object state) { tbInfected.AppendText("\r\n" + t.wr.ToString()); }, null); } }