So this is probably the most CONFUSING thing I am going to ask. I can't find anything online.
So currently I am working on an application in Visual C#, for Windows.
And basically it's a Console application that takes commands and I want a proper way to create commands.
For example, my current usage is that I take user input and check if the command is there using the String.Contains(); method. Then I check if the parameters are there using String.Contains();
Example:
if the command was "order" and parameters could be "-food" and "-pizza" and "-xl"
then the command the user would type would be:
order -food -pizza -xl
the same way you would do so within linux as in
apt-get install python
but my question is that how do I make such a system WITHIN C# in windows, without using the String.Contains(); system.
Because, in my food example, this is what I wouldve done with the input I grab:
I would check if the command contains "order" then I would check if it contains "-food" then I would check if it contains "-pizza" then I would check if it contains "-xl"
This is a very bad thing I know.
So is there a proper way I can do this in c#?
And no I don't want exe's that are launched via Command Prompt, like the way you do
ping 192.168.1.1
I want it so the "command prompt" or "terminal" is within my console application, in c# and i can enter commands.
I went in as specific as possible but I can't go in anymore.
I'm looking for what this guy is saying: C#: How to detect arguments typed into console application?