开发者

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!");
    }
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜