I’m new to the programming world.
I have a data extractor program which extracts data from MySQL into a word template file. I don’t understand how the main program knows which argument to pass into the parameters. When running the exe, how does the program knows that "Haha, I need to pass a string in there, And it is precisely this string right here" ???.
EDIT:
This program is supposed to be run when pressing a `Extraction Button’ but how the exe program knows where is the string arg parameters? where does the exe get it from?
MAIN CODE
private static void Main(string[] args)
{
try
{
if (args[0] == "ALL" || args[0] == "*" || args[0] == "all")
{
PrintARs();
Console.Read();
}
else
{
CreateARDocument(args[0]);
}
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
Console.Read();
}
}
There are a number of ways: