Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.
Private Sub BackgroundWorker4_DoWork(ByVal sender As System.Object, ByVal e As System.ComponentModel.DoWorkEventArgs) Handles BackgroundWorker4.DoWork ifonline1 = 0 counter = 0 InitializeTimer() MsgBox("Attempting to power on " & strcomputer) Do Until ifonline1 = 1 Or counter >= 5 On Error Resume Next Dim Ping As New Net.NetworkInformation.Ping Dim PingOptions As New Net.NetworkInformation.PingOptions PingOptions.Ttl = 64 Dim PingReply As Net.NetworkInformation.PingReply = Ping.Send(strcomputer, 200) If PingReply.Status = Net.NetworkInformation.IPStatus.Success Then ifonline1 = 1 flag4 = "ON" Else ifonline1 = 0 flag4 = "OFF" End If Loop MsgBox(flag4) If ifonline1 = 1 Then Dim Host As Net.IPHostEntry = Net.Dns.GetHostEntry(strcomputer) Dim firstaddress As Net.IPAddress = Host.AddressList(0) ip = firstaddress.ToString End If flag1 = pc3 flag2 = ip flag3 = rownum worker.ReportProgress(prog1) Next End Sub Private Sub InitializeTimer() ' Run this procedure in an appropriate event. counter = 0 Timer1.Interval = 1000 Timer1.Enabled = True End Sub Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick If counter >= 6 Then ' Exit loop code. Timer1.Enabled = False counter = 0 Else 'MsgBox(counter) ' Run your procedure here. ' Increment counter. counter = counter + 1 End If End Sub
|maro to copy and paste from one worksheet to another based on a condition||11||53|
|passing a value with stream reader AFTER a ";"||3||66|
|Do my app need to have windows media player to use axwindowsmediaplayer in Visual Basic?||6||72|
|Formula problem with Excel attachment||6||26|
Join the community of 500,000 technology professionals and ask your questions.
Connect with top rated Experts
12 Experts available now in Live!