Protected Sub gvDevice_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles gvDevice.RowDataBound If (e.Row.RowType = DataControlRowType.DataRow) Then Dim imgStatuss As Image = e.Row.FindControl("imgStatus") Dim status As String = DataBinder.Eval(e.Row.DataItem, "IPAddress") Dim ping As Ping = New Ping() Dim pingreply As PingReply = ping.Send(status)'---->tatus is IP Address Dim reply As String = pingreply.Status If (reply = 0) Then'---> if reply is 0 it can ping,if other than 0 can not ping ip address imgStatuss.ImageUrl = "~/images/icon_Status-Connected.png" Else imgStatuss.ImageUrl = "~/images/icon_Status-Disconnected.png" End If End If End Sub
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)