how to send 2-3 param’s to Winform C# program ?
for example: i’ll send something like MyProg.exe 10 20 "abc"
and in my program i can receive those values
(i dont want to show MyProg.exe – it will work background)
thank’s in advance
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Open up your
Program.cswhich is the entry point of your application. The main method is the one that fires up your application and this is the entry method.You need to modify it a bit by chaning:
static void Main()to something else that will allow you to send anarrayof elements.Try changing it to:
static void Main(string[] args)and loop through args and see what you get.You can see a bit more examples and explenations over here: Access Command Line Arguments.
There are good libraries which will help you out a bit to parse these command line arguments aswell.
Examples
To give you a bit more information I put together an example on an alternative way as Kobi mentioned:
CommandLineArguments.exe -q a -b rwill then Output
The same result would also be possible with this way