protected void GridView1_DataBound(object sender,EventArgs e)
{
for (int i = 0; i < GridView1.Rows.Count; i++)
{
Ping p1 = new Ping();
p1.PingCompleted += new PingCompletedEventHandler(this.PingCompletedCallBack);
p1.SendAsync(GridView1.Rows[i].Cells[3].Text.ToString(),1000,32);
}
}
private void PingCompletedCallBack(object sender, PingCompletedEventArgs e)
{
PingReply reply = e.Reply;
Response.Write(reply.Status);
}
GridView1系結資料的時候,從表中回圈取中IP列的值,執行異步ping, 但是回傳的結果與每一步所ping的IP地址不對應,有什么辦法可以解決么?看到有人說可以用e.userstate,但是不知道如何用………………這個問題困擾了我一個星期了,求高人指點!!!!!!
轉載請註明出處,本文鏈接:https://www.uj5u.com/net/276485.html
標籤:ASP.NET
