VB.Net/Language Basics/Main Function

Материал из VB Эксперт
Перейти к: навигация, поиск

Main function call your function

Imports System
public class MainClass
    Shared Sub Main()
       Console.WriteLine("In Main! Calling SomeMethod()")
       SomeMethod()
       Console.WriteLine("Back in Main().")
    End Sub
    Shared Sub SomeMethod()
       Console.WriteLine("Greetings from SomeMethod!")
    End Sub
End Class


Main function Demo

Imports System
public class HelloWorld
   Shared Sub Main()
      System.Console.WriteLine("a")
   End Sub
End Class