What would be considered a VB.NET module in C#?
VB.NET has classes and Modules, so my first question is what is the difference? Also, I noticed 开发者_StackOverflow中文版that C# does not have modules, but just classes, is there something in place of modules or were they removed for C#?
About the closest thing to a VB module would be a static class in C#.
For Example:
In VB.NET
Module SomeModule
Public Sub DoSomething
MsgBox("Doing something!")
End Sub
End Module
Same thing in C#:
public static class DoSomethingFuncs
{
public static void DoSomething() {
MessageBox.Show("Doing something!");
}
}
精彩评论