command line arguments
-
Hello, I am developing C# form application. I want to pass some user editable command line data to application before execution. So that i can read it before main() gets execute. How can i pass these data and read it from my application. Thanks. Gajesh
-
Hello, I am developing C# form application. I want to pass some user editable command line data to application before execution. So that i can read it before main() gets execute. How can i pass these data and read it from my application. Thanks. Gajesh
static void Main(string[] args) {} where args is a string aray that has the command line arguments in it split by spaces. Heres one of the articles you'll find right here on codeproject if you search ... http://www.codeproject.com/csharp/Command_Line.asp[^]
-
static void Main(string[] args) {} where args is a string aray that has the command line arguments in it split by spaces. Heres one of the articles you'll find right here on codeproject if you search ... http://www.codeproject.com/csharp/Command_Line.asp[^]
thanks originSH, But how end user will pass data from application exe? I thought of editing the application properties(RClick on application icon -> propertry) but i couldn't find command line editor in any of the tab. Thanks.
-
Hello, I am developing C# form application. I want to pass some user editable command line data to application before execution. So that i can read it before main() gets execute. How can i pass these data and read it from my application. Thanks. Gajesh
gajesh wrote:
So that i can read it before main() gets execute.
Nothing happens before main gets executed. Your command line args are available from the Application object, however.
Christian Graus - Microsoft MVP - C++ "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
-
thanks originSH, But how end user will pass data from application exe? I thought of editing the application properties(RClick on application icon -> propertry) but i couldn't find command line editor in any of the tab. Thanks.
gajesh wrote:
But how end user will pass data from application exe?
*from* the app ? You can pass data TO the app, on the command line.
gajesh wrote:
I thought of editing the application properties(RClick on application icon -> propertry) but i couldn't find command line editor in any of the tab.
you can only edit the command line of a shortcut, not the app itself
Christian Graus - Microsoft MVP - C++ "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
-
thanks originSH, But how end user will pass data from application exe? I thought of editing the application properties(RClick on application icon -> propertry) but i couldn't find command line editor in any of the tab. Thanks.
gajesh wrote:
But how end user will pass data from application exe?
Either by launching program from cmd or by modifying target which is on the shortcut tab of properties window
#region signature my articles #endregion
-
Hello, I am developing C# form application. I want to pass some user editable command line data to application before execution. So that i can read it before main() gets execute. How can i pass these data and read it from my application. Thanks. Gajesh
I think you are talking about console application in c# if u look at your main method static void Main(string[] args) { // // TODO: Add code to start application here // /// Added next line to print input on console Console.WriteLine(args[0]); } it accepts array of string, this is area where u can pass values e.g myapplication.exe parameter Atul kumar