|
-
Mar 27th, 2009, 03:21 PM
#1
Thread Starter
Lively Member
Application Arguements
Hi,
My intentions are to add command line switching. I am trying to see if i could run my application in varoius ways i.e.
App.exe -S - Start the application in XX Mode
app.exe -T30 - Start application with 30 second delay
and that kinda switching.
Thanks
Stuart
-
Mar 27th, 2009, 03:28 PM
#2
Re: Application Arguements
Thats not really a question - do you mean how would you do it?
http://www.devx.com/dotnet/Article/10115
-
Mar 27th, 2009, 03:32 PM
#3
Thread Starter
Lively Member
Re: Application Arguements
Hi, Yeah i realise how i put it sorry for that, i am looking at how to do it.
Will look at the link.
Thanks
-
Mar 27th, 2009, 03:33 PM
#4
Re: Application Arguements
If you want to test your app with different command line arguments, you can do that in the IDE.
Go to Project -> YourApp Properties... -> Debug and enter them into the text box.
-
Mar 27th, 2009, 03:43 PM
#5
Thread Starter
Lively Member
Re: Application Arguements
Hi, thanks for all of the replies. I have looked at the example in the link above but it is for a console application. is there a way of doing it for a windows application
Thanks
Stu
-
Mar 27th, 2009, 03:51 PM
#6
Re: Application Arguements
Yes, you can access the arguments using;
Code:
'Test for arguments using
Dim NumberOfArgs As Integer = Environment.GetCommandLineArgs.Length
Dim MyApp As String = Environment.GetCommandLineArgs(0)
Dim FirstArgument As String = Environment.GetCommandLineArgs(1)
The first argument is the command, which is the yourapplication.exe part.
-
Mar 27th, 2009, 03:54 PM
#7
Re: Application Arguements
The same applies in windows app as console app : the Command object allows access to command line parameters.
As Bulldog says above you can test this by setting them via the Debug tab of your projects properties page.
-
Mar 27th, 2009, 03:59 PM
#8
Thread Starter
Lively Member
Resolved: Application Arguements
Hi, you guys are a great help
thanks
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|