小编Pet*_*ete的帖子

NDESK在VB.NET中进行命令行解析

虽然我尝试了很多次,但我无法将NDESK.Options解析示例转换为简单的vb.net代码(抱歉,我不是专业版).

他们提供的唯一示例如下:http: //www.ndesk.org/doc/ndesk-options/NDesk.Options/OptionSet.html

但是,我不明白代码的这个关键部分:

var p = new OptionSet () {
        { "n|name=", "the {NAME} of someone to greet.",
          v => names.Add (v) },
        { "r|repeat=", 
            "the number of {TIMES} to repeat the greeting.\n" + 
                "this must be an integer.",
          (int v) => repeat = v },
        { "v", "increase debug message verbosity",
          v => { if (v != null) ++verbosity; } },
        { "h|help",  "show this message and exit", 
          v => show_help = v != null }, …
Run Code Online (Sandbox Code Playgroud)

vb.net parameters command-line parsing

2
推荐指数
1
解决办法
641
查看次数

标签 统计

command-line ×1

parameters ×1

parsing ×1

vb.net ×1