[Help]

Posts 1–11 of 11 · Page 1 of 1
[Help]
im getting this error:

Code:
Error	6	Too many arguments to 'Public Sub New()'.

Code:
 Dim objController As New ServiceController("spooler")
("spooler") is where the error is located. it doesnt matter what i put there i still get the error.

any help would be appreciated.
Quote Originally Posted by XGelite View Post
im getting this error:

Code:
Error	6	Too many arguments to 'Public Sub New()'.

Code:
 Dim objController As New ServiceController("spooler")
("spooler") is where the error is located. it doesn't matter what i put there i still get the error.

any help would be appreciated.
I remember i got this error a while back Cant seem to remember what i did

ill let you know if i remember
Heres the msdn article for you
Code:
http://msdn.microsoft.com/en-us/library/system.serviceprocess.servicecontroller.aspx
Has this been solved? Also, post the section of code that you are getting the error in
Quote Originally Posted by Bombsaway707 View Post
Has this been solved? Also, post the section of code that you are getting the error in
i did post the section of code. No it hasnt been solved yet, b/c i havnt had time to figure it out yet. other i have to do right now. i just posted this here incase somebody already knew the answer so i wouldnt have to spend time figuring it out myslef. lol
hmmm maybe the format is wrong?

can i see the codes inside Public Sub New()
ok heres a small bit of the code.

Code:
 Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click

        Dim objController As New ServiceController() '' put in service here ("")


        If objController.Status = ServiceControllerStatus.Running Then
            objController.Stop()
        End If
        Button2.Hide()
        Button3.Show()
    End Sub
doesnt give me any error unless i put the name of the service i want here ()

im trying to stop windows services.
Quote Originally Posted by XGelite_backup View Post
ok heres a small bit of the code.

Code:
 Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
 
        Dim objController As New ServiceController() '' put in service here ("")
 
 
        If objController.Status = ServiceControllerStatus.Running Then
            objController.Stop()
        End If
        Button2.Hide()
        Button3.Show()
    End Sub
doesnt give me any error unless i put the name of the service i want here ()

im trying to stop windows services.
yah but dont you have to put the service between the ()'s?
Quote Originally Posted by Bombsaway707 View Post
yah but dont you have to put the service between the ()'s?
yep i do...
Shot in the dark but is it possible it can not stop the service without permission?? Try building it and running it as admin. Otherwise IDK but my best guess is permissions.
Quote Originally Posted by ROUGHS3X View Post
Shot in the dark but is it possible it can not stop the service without permission?? Try building it and running it as admin. Otherwise IDK but my best guess is permissions.

thats not the problem . i cant even build it b/c of error. you can run a program that gives you an error. so there is nothing to try. i still haven't had time to work on it lately. wont have time until Monday.

thanks though.
Posts 1–11 of 11 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Talk with us