Hai
How to refresh specific service via vb in asp.net.i dont want stop and start or restart service.i will use following code for restart service.
Private Sub startservice()
Dim scServices() As ServiceController
scServices = ServiceController.GetServices()
Dim scTemp As ServiceController
For Each scTemp In scServices
If scTemp.ServiceName = "sample service name" Then
Dim sc As New ServiceController("sample service name")
Dim aa As String = sc.Status.ToString()
If sc.Status = ServiceControllerStatus.Stopped Then
sc.Start()
While sc.Status = ServiceControllerStatus.Stopped
Thread.Sleep(5000)
sc.Refresh()
End While
End If
End If
Next scTemp
End Sub
the above code for used for restart service,so i use sc.Stop() and sc.Start().
Note:
i dont want above code for refersh service,like stop,start,restart.
i need refersh service via web.
if we open Services form Control Panel,we have 4 types of funtion for service
like if we select service and can click Stop,Start,Restart and refresh(semi green circle next to main menu )
The refersh one i need in vb code format. sc.Refersh() is correct ?
pls reply asap
regards
AravindB