问题
Background Information (based on my first question): i want to integrate in my "GUI.exe" (written in c#) a help function. Then when i want to start in my cmd -> "GUI.exe --h" the help function.
Tried a stackoverflow- post: I have try to use this solution: Adding "--help" parameter to C# console application.
static bool ShowHelpRequired(IEnumerable<string> args)
{
return args.Select(s => s.ToLowerInvariant())
.Intersect(new[] { "help", "/?", "--help", "-help", "-h" }).Any();
}
Current problem:
I don't know where I can integrate the help function. I don't know whether a particular setting in my Microsoft Visual Studio must configure.
In advance thank you for your Support.
回答1:
Call ShowHelpRequired
in your main method :
static void Main(string[] args)
{
if(ShowHelpRequired(args))
{
Console.WriteLine("Show help message here");
}
}
来源:https://stackoverflow.com/questions/45707531/how-to-integrate-c-sharp-help-into-console-application