Making winforms application to accept command line arguments
In win forms thers a "main" method which does not accept any command line arguments.
How can we make windows forms application to accept command line arguments passed to it?. Please refer me to a good resource if possible
I tried the following in Win forms Application:-
Intially the main function was empty (i.e. with no arguments)
Then I did this:-
Static void Main(string args)
//the above line throws the following error messages:-
1. The best overloadded method mach for MessageBox.Show(string) has some invalid arguments.
2. Cannot convert from 'method group' to string.
Can any one suggest me whts wrong with it. And how to get out of it to make win forms app to accept commandline arguments and display them?.
When you call a method, such as ToString, you must include parentheses after the method name. If you change your code to:
it will run without error. The args array, however, already contains strings, so there's no need to call ToString. You may simply do this:
Finally, if you want to run this code within Visual Studio, you must specify at least one command line argument. In Visual Studio's Solution Explorer, double-click Properties, then select the Debug tab and enter a value in the Command Line Arguments field.
Please post questions to the forums, where others may benefit.
I do not offer free assistance by e-mail. Thank you!
Yes, that works.
By mako_123 in forum Java
Last Post: 10-06-2007, 01:15 PM
By Matrix.net in forum .NET
Last Post: 09-06-2006, 12:54 PM
By tomfluff in forum VB Classic
Last Post: 07-18-2006, 05:22 PM
By INA_ctive in forum .NET
Last Post: 06-23-2005, 12:38 AM
By Troy Easterling in forum Careers
Last Post: 12-29-2001, 08:49 AM
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center