Avatar of ube100
ube100
Flag for United Kingdom of Great Britain and Northern Ireland asked on

VB question

Hi,
I'm currently converting a vb application into c# service. I looked at the staring point for this appliaction which is form load event. This form load event has the following code:

Private Sub Form_Load()
Select Case UCase(Command)
Case "-I", "/I"
     If NTService.Install Then
         MsgBox NTService.DisplayName & _
                " installed successfully."
     Else
         MsgBox NTService.DisplayName & _
                " did not install successfully."
     End If
     End
Case "-U", "/U"
     If NTService.Uninstall Then
         MsgBox NTService.DisplayName & _
                " uninstalled successfully."
     Else
         MsgBox NTService.DisplayName & _
                " did not uninstall successfully."
     End If
     End
Case "-DEBUG"
    'call start up
    Main
   
Case ""
     '-- This code should only run when the
     '   application is started without parameters
     NTService.StartService
Case Else
     '-- This code should only run when the
     '   application is started with invalid
     '   parameters
     MsgBox "The parameter: " & Command & " was is not understood." & vbCrLf & "Try -I  (install) or -U (uninstall)."
     End
End Select
End Sub

As things standing at the moment I don't know what this programm is trying do? Can some body explain to me please. The command line argument was set to "-DEBUG"
 
Visual Basic Classic

Avatar of undefined
Last Comment
GrahamSkan

8/22/2022 - Mon
GrahamSkan

We can only give general comments, but it is obviously a command line parser.

Specifically if the command line is "-DEBUG", then the procedure name Main is called.
ube100

ASKER
Graham,

I understood that but how about other command values like "-I", "/I" or "-U", "/U" etc....

What are they trying do when the command line arguments are above?
 
ASKER CERTIFIED SOLUTION
GrahamSkan

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Your help has saved me hundreds of hours of internet surfing.
fblack61