예제 #1
0
 public void addResult(string imagePath)
 {
     if (this.InvokeRequired)
     {
         AddResultDelegate ard        = new AddResultDelegate(addResult);
         object[]          parameters = { imagePath };
         this.Invoke(ard, parameters);
     }
     else
     {
         imageListView1.Items.Add(imagePath);
     }
 }
예제 #2
0
        private void CheckComputer(Object obj)
        {
            string            ip = obj as string;
            AddResultDelegate d  = new AddResultDelegate(AddResult);

            try
            {
                Ping      ping  = new Ping();
                PingReply reply = ping.Send(ip);
                if (reply.Status == IPStatus.Success)
                {
                    listBoxStatus.Invoke(d, "IP地址:" + ip + "状态:扫描成功!");
                }
                else
                {
                    listBoxStatus.Invoke(d, "IP地址:" + ip + "状态:扫描失败!");
                }
            }
            catch
            {
                listBoxStatus.Invoke(d, "IP地址:" + ip + "状态:扫描失败!");
            }
        }
예제 #3
0
파일: MainForm.cs 프로젝트: Maxim3000/Zookr
 public void addResult(string imagePath)
 {
     if (this.InvokeRequired)
     {
         AddResultDelegate ard = new AddResultDelegate(addResult);
         object[] parameters = { imagePath};
         this.Invoke(ard, parameters);
     }
     else
     {
         imageListView1.Items.Add(imagePath);
         
     }
 }