int click_all = z - 1;
MessageBox.Show(click_all.ToString());
z = 0;
click_all = 0;
}
else
{
hexing_thread();
Application.DeEvents();
}
}
public void hexing_name_select()
{
hexing_line hexing = new hexing_line();
for (int i = 0; i < hexing.hexing_name.Count(); i++)
{
hexing_date.Rows.Add();
hexing_date.Rows[i].Cells[0].Value = hexing.hexing_name[i];
hexing_date.Rows[i].Cells[1].Value = hexing.hexing_ip[i];
}
}
public void hexing_thread()
{
int line_count = hexing_date.RowCount;//统计datagridview有多少行,就在下面设置多个线程
Thread[] line_PING = new Thread[line_count];
for (int a = 0; a < line_count; a++)
{
line_PING[a] = new Thread(new ParameterizedThreadStart(hexing_ping));
line_PING[a].Start(a);
}
}
public void hexing_ping(object obj)
{
int i = Convert.ToInt32(obj);
Ping pp = new Ping();
PingReply ppResult = pp.Send(Convert.ToString(hexing_date.Rows[i].Cells[1].Value), 10);