visual studio中C#的注释

1、单行注释

单行注释通常写在简单语句后面,通过双斜杆//表示单行注释的开始。

s=textBox1.SelectedText;  //选中的文本送入剪贴板

2、块注释

块注释使是用来注释多行连续内容的,它将要注释的内容用一对/*和*/符号闭合。

        /*
            This is not the real code;
            It's just annotate.
            It will be ignored by the compiler.
        */

3、文档注释

C#还提供文档注释。这种注释形式上带有XML标签,可以由.NET提供的文档生成系统自动生产项目文档,非常适用于大型项目的开发。看上去和单行注释很像,以三个///开头。

        ///<summary>
        ///This class represent a new Program.
        ///</summary>
发布了87 篇原创文章 · 获赞 324 · 访问量 48万+

猜你喜欢

转载自blog.csdn.net/qq_35379989/article/details/101980971