|
-
Oct 26th, 2009, 09:24 PM
#1
Thread Starter
Fanatic Member
[RESOLVED] How can my app. accept arguments?
Hello,
I'm currently making a text editor, and I wanted to make my application accept arguments from the command prompt, you know <Directory>\myapp.exe <textfile>. How can I do this?
Thanks in advance
-
Oct 26th, 2009, 09:38 PM
#2
Re: How can my app. accept arguments?
Environment.GetCommandlineArgs will get you an array any time. You can also access them in the application Startup event via the 'e' parameter.
-
Oct 26th, 2009, 09:45 PM
#3
Thread Starter
Fanatic Member
Re: How can my app. accept arguments?
Enviroment.GetCommandlineArgs should be at the Form.Load event? When you say:
You can also access them in the application Startup event via the 'e' parameter.
You are talking about the Form.Load event,right?
-
Oct 26th, 2009, 09:50 PM
#4
Re: How can my app. accept arguments?
 Originally Posted by tassa
Enviroment.GetCommandlineArgs should be at the Form.Load event?
That's completely up to you. Do you need the commandline arguments in the Form's Load event handler? If so then that's where you should call the method. If you need them somewhere else then you call it soemwhere else.
 Originally Posted by tassa
You are talking about the Form.Load event,right?
No, if I'd meant that I would have said that. I mean the Startup event of the application itself. You can access application events from the project properties.
-
Oct 26th, 2009, 09:58 PM
#5
Thread Starter
Fanatic Member
Re: How can my app. accept arguments?
Oh, ok. Got it. Thanks a lot John .
Thread Resolved!
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
|