日期:2014-05-17 浏览次数:20889 次
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_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);
hexing_date.Rows[i].Cells[2].Value = ppResult.RoundtripTime.ToString();
hexing_date.Rows[i].Cells[3].Value = ppResult.Status.ToString();
hexing_date.Rows[i].Cells[4].Value = z;
}
static System.Windows.Forms.Timer myTimer = new System.Windows.Forms.Timer();
public void hexing_click_select(object source, EventArgs e)
{
//myTimer.Stop();我尝试了下,这个stop不stop都不会影响到ping的时候会卡界面的情况。
z+=1;
if (z < 10)
{
hexing_thread();
myTimer.Enabled = true;////是不是这一句起到了作用?求解
}
else
{
myTimer.Enabled = false;
}
}
public void he