這個問題必須是一個非常基本的問題,但是經過一段時間後在互聯網上磕磕絆絆,我無法理解下面的代碼。我對c#很陌生。究竟是什麼的[]
(方括號)使用情況在以下語法中使用方括號「[]」有什麼用途
class Options
{
[Option('f', "file", Required = true,
HelpText = "Input file to be processed.")]
public string InputFile { get; set; }
[Option('o', "outprefix", Required = true,
HelpText = "Output prefix for file.")]
public string OutPreFix { get; set; }
[Option('v', "verbose", DefaultValue = false,
HelpText = "Prints all messages to standard output.")]
public bool Verbose { get; set; }
[ParserState]
public IParserState LastParserState { get; set; }
[HelpOption]
public string GetUsage()
{
return HelpText.AutoBuild(this, (HelpText current) => HelpText.DefaultParsingErrorsHandler(this, current));
}
}
謝謝。我將確保下次不會添加重複的問題。道歉 !! – 2013-05-10 10:53:45
謝謝Habib ...現在去鏈接... – 2013-05-10 11:41:33