我是一个新手,自学VB,以VS 2012作为IDE。
我有2个程序,#1有效,#2不可用吗?请说明为什么(#1无效)?
'Program #1
Module Module1
' calculation of square root of 2
Sub Main()
Dim root As Double = Math.Sqrt(2)
MsgBox("The square root of 2 is " & root)
End Sub
End Module
'Program #2
Imports System.Windows.Forms ' namespace containing MessageBox
' calculation of square root of 2
Module mSquareRoot
Sub Main()
Dim root As Double = Math.Sqrt(2)
MessageBox.Show("The square root of 2 is " & root)
End Sub
End Module