jorge Posted August 30, 2003 Posted August 30, 2003 ok, My startup object is sub main, here is what i want, if my.exe -server is started it would display a msg box, if my.exe is started it schould continue loading. buti t says command() is private so i can't use it? whats wrong? thanx in advance Jorge Quote Jorge - http://www.blackdot.be/?page=apache.htm
*Experts* mutant Posted August 30, 2003 *Experts* Posted August 30, 2003 To get the command line use: System.Environment.CommandLine Quote
jorge Posted August 31, 2003 Author Posted August 31, 2003 Dim sCommand As String = System.Environment.CommandLine sCommand = sCommand.ToLower() If sCommand = "-server" Then Call remote() Exit Sub End If that my code, but it does nothing, it doe not go to remote! Quote Jorge - http://www.blackdot.be/?page=apache.htm
Administrators PlausiblyDamp Posted August 31, 2003 Administrators Posted August 31, 2003 try Dim sCommand As String = System.Environment.GetCommandLineArgs(1) sCommand = sCommand.ToLower() If sCommand = "-server" Then Call remote() Exit Sub End If instead - System.Environment.CommandLine returns the entire command line including the path to the application. GetCommandLineArgs() splits the commandline into an array of seperate arguments with index 0 being the application. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
jorge Posted August 31, 2003 Author Posted August 31, 2003 it gives: index out of reange as error Quote Jorge - http://www.blackdot.be/?page=apache.htm
Administrators PlausiblyDamp Posted August 31, 2003 Administrators Posted August 31, 2003 If you use MessageBox.Show (System.Environment.CommandLine) what does it display? Also try and display System.Environment.CommandLineArgs (0) and (1) Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
jorge Posted August 31, 2003 Author Posted August 31, 2003 ok, found it, i used () instead of (1) :eek: Quote Jorge - http://www.blackdot.be/?page=apache.htm
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.