Results 1 to 5 of 5

Thread: Enabling the windows messenger service

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Mar 2006
    Posts
    22

    Enabling the windows messenger service

    Is it possible to enable the windows messenger service (famous net send) with a vb .net code??
    I suppose the answer is yes!

    Can you explin me how to do it? If possible, remotly!

  2. #2
    PowerPoster
    Join Date
    Aug 2005
    Location
    College Station, TX
    Posts
    4,521

    Re: Enabling the windows messenger service

    You can use the ServiceController class in order to start and stop services. An example of starting the "Themes" service is below:
    VB Code:
    1. Dim MyController As New System.ServiceProcess.ServiceController("Themes")
    2.         If MyController.Status = ServiceProcess.ServiceControllerStatus.Stopped Then
    3.             MyController.Start()
    4.             MsgBox("successfully started!")
    5.         Else
    6.             MsgBox("Its already started!")
    7.         End If
    Just need to replace "Themes" with the service that it is...

    **Note - this does not take into account any error handling if there are problems with trying to start or stop

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Mar 2006
    Posts
    22

    Re: Enabling the windows messenger service

    Thank u very much! The code has worked!

    Is there any way to make the same thing but remotly (in a LAN)??

  4. #4
    PowerPoster
    Join Date
    Aug 2005
    Location
    College Station, TX
    Posts
    4,521

    Re: Enabling the windows messenger service

    well if you look at the ServiceController class, you will see that there is another overloaded constructor that accepts the machine name as a parameter (i think If I remember correctly), and I believe that you just tack it on after the service name, like:
    VB Code:
    1. Dim MyController As New System.ServiceProcess.ServiceController("Themes", MachineName)

  5. #5

    Thread Starter
    Junior Member
    Join Date
    Mar 2006
    Posts
    22

    Re: Enabling the windows messenger service

    OK Thank you very much!
    I'll try that!

    So, to terminate the project I need to have a list of network computers (LAN)
    http://www.vbforums.com/showthread.php?t=392041

    Can you help me?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width