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, 12:15 PM
By Matrix.net in forum .NET
Last Post: 09-06-2006, 11:54 AM
By tomfluff in forum VB Classic
Last Post: 07-18-2006, 04:22 PM
By INA_ctive in forum .NET
Last Post: 06-22-2005, 11:38 PM
By Troy Easterling in forum Careers
Last Post: 12-29-2001, 07:49 AM
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL