线程间操作无效
Process[] processes=Process.GetProcesses();private void theout (object source,System.Timers.ElapsedEventArgs e)
{
for (int i = 0; i < processes.GetLength(0); i++)
{
listBox1.Items.Clear();
listBox1.Items.Add(processes[i].ProcessName);
}
}
private void Form1_Load(object sender, EventArgs e)
{
System.Timers.Timer t = new System.Timers.Timer(1000);
t.Elapsed += new System.Timers.ElapsedEventHandler(theout);
t.AutoReset = true;
t.Enabled = true;
}
这个怎么处理啊,最好的处理方式!