Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. how to get the status of the Windows service in aspx page

how to get the status of the Windows service in aspx page

Scheduled Pinned Locked Moved ASP.NET
csharpasp-nettutorial
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    ramyasangeet
    wrote on last edited by
    #1

    hi , I have created a Windows Service application and it is running in a host.I want to get its status in aspx page.Like whether the service is started or stopped. Is it possible to get status of WindowsService in Asp.net. Plz give ur suggestions.. thanks in advance

    cheers sangeet

    J 1 Reply Last reply
    0
    • R ramyasangeet

      hi , I have created a Windows Service application and it is running in a host.I want to get its status in aspx page.Like whether the service is started or stopped. Is it possible to get status of WindowsService in Asp.net. Plz give ur suggestions.. thanks in advance

      cheers sangeet

      J Offline
      J Offline
      Jesse Squire
      wrote on last edited by
      #2

      Assuming that your service is running on the same machine as your ASP.NET application, you could use WMI to query the service status. WMI functionality is exposed through the System.Management namespace. Like any system-level functionality, you'll need to have the proper permissions to expose this information. If your service is on a different machine, or you aren't able to secure the proper permissions, you may wish to consider exposing a remoting interface from your service. In that way, you could connect to your service programatically, and ask it for a report of its current status. The catch here is that you'll need to write code in the service that can understand and report on its status. Another thing to be aware of is that if your service is not currently started, the connection will fail. Here are a couple of resources to help get you started:

      • MSDN Article: Monitoring and Dynamically Configuring Windows Services[^]
      • CodeProject Article: Exposing Windows Service[^]
      • Google Results for: "WMI and Windows Service and .NET"[^]

      Hope that helps. :)

      --Jesse

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups