///和#region之間的區別是什麼##區域 c#中的註釋語句?哪一個最好?c /#和#region之間的區別#
2
A
回答
29
#region
根本不是評論聲明。它用於標記代碼段。 ///
用於documentation comments。
3
///用於XML註釋,而區域不用於評論,但用於將代碼段組合在一起。
2
///
- >可用於一些評論
#region ...#endregion
- >可以被用於標記的代碼組特定的區域,易於reffer
#region MainMethod
/// <summary>
/// Comments
/// </summary>
static void Main()
{
//Your code
}
#endregion
1
19
/// <summary>
/// Three forward slashes denote a documentation comment, which can be used in
/// conjunction with documentation tooling to generate API documentation for
/// your code.
/// </summary>
// two forward slashes denote a code comment, which you can use to provide
// commentary within your code
/*
This style of comment is called a block comment, which can be used to easily
comment out large blocks of text within your code
*/
#region Some Region Name
// the above region allows the developer to collapse/uncollapse everything
// within it, as long as their IDE supports regions
public void SomeMethod()
{
}
#endregion
1
///用來在你的代碼中插入XML註釋。 Xml註釋允許您從項目中構建一個輸出Xml文件: 稍後,Visual Studio將使用此文件向您顯示帶有插入註釋的智能感知工具提示。此外,您可以使用eit來構建自己的文檔。 從你的源代碼看這裏有關how to build documentation的文章Xml評論
#region用來組織你的代碼。
3
#region
,使你的代碼可讀性/維護只有IDE內有用它理解它(VS),讓您可以摺疊或展開的代碼,每一個地區你#區/#endregion定義/多組織
///
文件代碼!
0
一個區域用於摺疊大面積的代碼,//用於在計算機不讀取它的情況下添加註釋。
#region your large code
loads of code in this area.
#endregion
//This is just a note that the computer won't read.
相關問題
- 1. C#「var」和C++「auto」之間的區別
- 2. Java和C#和.NET之間的區別
- 3. `%in%`和`==`之間的區別
- 4. ==和case之間的區別?
- 5. C中的/ +和+之間的區別?
- 6. 和之間的區別。在Objective-C
- 7. ASP.Net,C#.Net和VB.Net之間的區別?
- 8. C#中char和int之間的區別#
- 9. VS DataBreakpoints:C和C++之間的區別
- 10. ASP和C#之間的語義區別?
- 11. C#中Convert.ToString()和.ToString()之間的區別?
- 12. objective-c和java之間的區別
- 13. C++ Builder - Lib和Res之間的區別
- 14. Ruby和C之間的主要區別
- 15. C++ OOP和PHP OOP之間的區別
- 16. '+ ='和'= +'之間的區別?
- 17. {!!之間的區別!!}和{{}}
- 18. '#','%'和'$'之間的區別
- 19. | =和^ = css之間的區別
- 20. 「%〜dp0」和「。\」之間的區別?
- 21. .eq之間的區別。和==
- 22. ==和.equals()之間的區別?
- 23. SPFile和PublishingPage類別之間的區別
- 24. System.Timers.Timer Enabled = true和.Start()之間的區別Enabled = true和.Start()之間的區別
- 25. a + b和.__之間的區別__(b)
- 26. Python:!=和「不是」之間的區別
- 27. plyr :: mutate和dplyr :: mutate之間的區別
- 28. uint和unsigned int之間的區別?
- 29. -match和|之間的區別其中{$ _ -match ...}
- 30. '|'之間的區別和 '+' 的位操作
+1 ...和四個斜槓////是註釋掉實際代碼行的標準,其中/ * * /不起作用(並停止ReSharper呻吟:) – 2010-09-20 13:02:32