Its really really hard to explain what i am trying to do, so i will just explain what is the program i am trying to build.
I am building a Console App in C#.
I need to run it every day at 6:00. I have already built the timer for it, but i need it to get parameter with a “Name” like when you run it into PowerShell. I need to do something like that:
.\run.exe Name
which in my program I need the name in a string, and write with it.. and use it ofc.
i will like to know how to add it, so i can do even:
.\run.exe Name Name2 Name3
Thanks again everyone, you are helping me here alot!
Your Console App entry point may look like
the args array contains all parameters you have passed via command line. The different elements are those that were separated by space.
So if you call your prog like
prog.exe Name, args[0] will contain the value “Name”.args.Lengthwill have the value 1 . If you callprog.exe Name X,args.Lengthwill be 2 andargs[1]will be “X”.