aderesh aderesh - 1 year ago 93 Question

What is equivalent for c# anonymous code blocks?

What is VB.NET equivalent for this code

void foo()
{ //anonymous code block starts here
} //anonymous code block ends here

Answer Source

There isn't an equivalent anonymous code blocks in VB.NET.

You can emulate with an if true:

If True Then
End If

Or if you don't need a block scope, you can use the regions:

#Region "This is the code to be collapsed"
#End Region
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download