vb.net 中的多行注释
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/5083243/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
multiline comment in vb.net
提问by krum_cho
Do we have a multi line comment in VB.net.
I know in Java we have /* */ but that doesn't seem to work here.
我们在 VB.net 中有多行注释吗?
我知道在 Java 中我们有 /* */ 但这似乎在这里不起作用。
回答by JonH
No we dont unfortunately..........
不,我们不不幸......
You can do: Ctrl + K, Crtl + C
你可以这样做:Ctrl + K、Crtl + C
To uncomment ctrl+k ctrl+u
取消注释 ctrl+k ctrl+u
回答by schlebe
In Visual Basic .Net 2008 and 2010, I use the following C++ Workaround.
在 Visual Basic .Net 2008 和 2010 中,我使用以下 C++ 解决方法。
#If AFAC Then
#If AFAC Then
#End if
#End if
For english speaking AFAC = "à effacer" = "to delete"
对于英语 AFAC = "à effacer" = "to delete"
I alreay use #If COMMENT
or #If TODO
我已经使用#If COMMENT
或#If TODO
The #if COMMENT thensolution is more power than the C++/Java/C# /* text \*/
solution because it is possible to imbricate (embed) #if
but not /*
!!!
所述的#if COMMENT然后溶液比C ++ /爪哇/ C#更多的功率/* text \*/
解决方案,因为它是能够覆瓦状(嵌入)#if
但不/*
!!!
For more information see the following link
有关更多信息,请参阅以下链接
回答by Wizard
Just hold "alt"+"shift" and move cursor up or down to select lines, and press " ' "
只需按住“alt”+“shift”并向上或向下移动光标以选择行,然后按“'”
回答by Tedd Hansen
Not possible. Write your chunk, select it and press Ctrl+K, Ctrl+C to comment it.
不可能。编写块,选择它并按 Ctrl+K、Ctrl+C 对其进行评论。
But it doesn't always matter as often you use ''' in front of a method or property to describe it. Then it will automatically create the comments for you.
但是并不总是像在方法或属性前使用 ''' 来描述它那样重要。然后它会自动为您创建评论。
回答by Nate Koppenhaver
Only single-line comments are possible in VB, unlike C/C++ and it's derivatives (Java, JavaScript, C#, etc.). You can use the apostrophe " ' " or REM (remark) for comments like this:
与 C/C++ 及其衍生物(Java、JavaScript、C# 等)不同,VB 中只能使用单行注释。您可以使用撇号“'”或 REM(备注)来表示这样的注释:
Sub Main()
' This is a comment
REM This is also a comment
End Sub
But there is no multi-line comment operator in VB, unless you count using the keyboard shortcuts like @JonH and @Tedd Hansen said.
但是在 VB 中没有多行注释运算符,除非您使用 @JonH 和 @Tedd Hansen 所说的键盘快捷键进行计数。