如何将C#帮助集成到控制台应用程序 [英] How to integrate c# help into console application
问题描述
背景信息(基于我的第一个问题):
我想在我的 GUI.exe(用C#编写)中集成一个帮助功能。
然后,当我想在cmd中启动-> GUI.exe --h帮助功能时。
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.
尝试了stackoverflow- post:
我尝试使用此解决方案:添加 --help ; C#控制台应用程序的参数。
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();
}
当前问题:
我不知道在哪里可以集成帮助功能。
我不知道是否必须配置Microsoft Visual Studio中的特定设置。
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.
在此先感谢您的支持。
推荐答案
在您的主要方法中调用 ShowHelpRequired
:
Call ShowHelpRequired
in your main method :
static void Main(string[] args)
{
if(ShowHelpRequired(args))
{
Console.WriteLine("Show help message here");
}
}
这篇关于如何将C#帮助集成到控制台应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!