In VB, a module is used to store loose code accessible from elsewhere in the application without having to first initialize something.
The state of the variable can be easily set or changed and that continues to carry on that value throughout.
For the same work in C#< use a static class.
Let us see an example −
VB
Module MyModule
Public Sub Display
MsgBox("Demo!")
End Sub
End ModuleC#
public static class Display {
public static void DisplayMethod() {
Console.WriteLine("Demo!");
}
}