Exemplo n.º 1
0
        void myThread()
        {
            //����һ��Threadʵ��

            Ping HostPing = new Ping();
            //����һ��pingʵ��
            HostPing.ip = TDService.StaticForm.ini.IniReadValue("Server", "ServerName");
            //HostPing.BangName = Bangfangs[k];
            HostPing.ul = new UpdateList(UpdateMyList);
            //�����pingʵ���д���IP��ַ�ַ���
            Thread thread = new Thread(new ThreadStart(HostPing.scan));
            //��ʼ��һ���߳�ʵ��
            thread.Start();
            //����߳�
        }
Exemplo n.º 2
0
        void myThread()
        {
            int Min = 1;
            int Max = Bangfangs.Length;

            //�ж������IP��ַ�����Ƿ�Ϸ�
            int _ThreadNum = Max - Min + 1;
            Thread[] mythread = new Thread[_ThreadNum];
            //����һ�����Threadʵ��
            progressBar1.Minimum = Min;
            progressBar1.Maximum = Max+1;
            progressBar1.Value = Min;
            int i;
            for (i = Min; i <= Max; i++)
            {
                int k = Max - i;
                Ping HostPing = new Ping();
                //����һ��pingʵ��
                HostPing.ip = TDService.StaticForm.ini.IniReadValue(Bangfangs[k], "IP");
                HostPing.BangName = Bangfangs[k];
                HostPing.ul = new UpdateList(UpdateMyList);
                //�����pingʵ���д���IP��ַ�ַ���
                mythread[k] = new Thread(new ThreadStart(HostPing.scan));
                //��ʼ��һ���߳�ʵ��
                mythread[k].Start();
                //����߳�
            }
        }