标题:线程间操作无效
只看楼主
mpdeng
Rank: 1
等 级:新手上路
帖 子:6
专家分:0
注 册:2014-7-25
结帖率:33.33%
 问题点数:0 回复次数:0 
线程间操作无效
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;
            
            
               
        }
这个怎么处理啊,最好的处理方式!
搜索更多相关主题的帖子: private source 
2014-10-29 10:53



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-437838-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.164521 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved