R
Rohan Danushka
Guest
Hello,
I'm try to display my application online status in StatusStrip Label. with this method timer calling the CheckInternetConn Function. but, when I disconnect the internet my application slow down and timer keep try to calling Function. how to fix this.
Timer (Tick) Code:
If K9Core.CheckInternetConn = True Then
tsslblIntSta.ForeColor = Color.Lime
tsslblIntSta.Text = "ONLINE"
ElseIf K9Core.CheckInternetConn = False Then
tsslblIntSta.ForeColor = Color.Red
tsslblIntSta.Text = "OFFLINE"
End If
My Function
Public Shared Function CheckInternetConn() As Boolean
If My.Computer.Network.IsAvailable = True Then
Dim objURL As New System.Uri("Google")
Dim objWebReq As System.Net.WebRequest
objWebReq = System.Net.WebRequest.Create(objURL)
Dim objResp As System.Net.WebResponse
Try
objResp = objWebReq.GetResponse
objResp.Close()
objResp = Nothing
Return True
Catch ex As WebException
objResp = Nothing
objWebReq = Nothing
Return False
End Try
End If
End Function
Exception Thrown :
Target: I need to show my application Online Status in front end (Automatically)
Known Issue: When Timer Keep try to call function application slow down
Thank you so much....
RohanD
Continue reading...
I'm try to display my application online status in StatusStrip Label. with this method timer calling the CheckInternetConn Function. but, when I disconnect the internet my application slow down and timer keep try to calling Function. how to fix this.
Timer (Tick) Code:
If K9Core.CheckInternetConn = True Then
tsslblIntSta.ForeColor = Color.Lime
tsslblIntSta.Text = "ONLINE"
ElseIf K9Core.CheckInternetConn = False Then
tsslblIntSta.ForeColor = Color.Red
tsslblIntSta.Text = "OFFLINE"
End If
My Function
Public Shared Function CheckInternetConn() As Boolean
If My.Computer.Network.IsAvailable = True Then
Dim objURL As New System.Uri("Google")
Dim objWebReq As System.Net.WebRequest
objWebReq = System.Net.WebRequest.Create(objURL)
Dim objResp As System.Net.WebResponse
Try
objResp = objWebReq.GetResponse
objResp.Close()
objResp = Nothing
Return True
Catch ex As WebException
objResp = Nothing
objWebReq = Nothing
Return False
End Try
End If
End Function
Exception Thrown :
Target: I need to show my application Online Status in front end (Automatically)
Known Issue: When Timer Keep try to call function application slow down
Thank you so much....
RohanD
Continue reading...