What is the difference between /// and #region in c#?

后端 未结 8 1979
隐瞒了意图╮
隐瞒了意图╮ 2021-02-13 03:57

What is the difference between ///

and #region ...#endregion statements in c#? Which one the best?

8条回答
  •  难免孤独
    2021-02-13 04:19

    /// is used to insert XML Comments in your code. Xml comments allow you to build an output Xml file from you project: This file is later used by Visual Studio to show you intellisense tooltip with the comments you inserted. Moreover, you can use eit to build your own documentation. See here an article about how to build documentation from your source code Xml comments

    #region is used to organize your code. It is only useful within IDE which understand it (VS), allowing you to collapse or expand every region of code you define with #region/#endregion

提交回复
热议问题