Peristiwa
17 Mac, 9 PTG - 21 Mac, 10 PG
Sertai siri perjumpaan untuk membina penyelesaian AI berskala berdasarkan kes penggunaan dunia sebenar dengan rakan pembangun dan pakar.
Daftar sekarangPelayar ini tidak lagi disokong.
Naik taraf kepada Microsoft Edge untuk memanfaatkan ciri, kemas kini keselamatan dan sokongan teknikal yang terkini.
Specifies the class or module that contains the Sub Main
procedure.
-main:location
location
Required. The name of the class or module that contains the Sub Main
procedure to be called when the program starts. This may be in the form -main:module or -main:namespace.module.
Use this option when you create an executable file or Windows executable program. If the -main option is omitted, the compiler searches for a valid shared Sub Main
in all public classes and modules.
See Main Procedure in Visual Basic for a discussion of the various forms of the Main
procedure.
When location
is a class that inherits from Form, the compiler provides a default Main
procedure that starts the application if the class has no Main
procedure. This lets you compile code at the command line that was created in the development environment.
' Compile with /r:System.dll,SYSTEM.WINDOWS.FORMS.DLL /main:MyC
Public Class MyC
Inherits System.Windows.Forms.Form
End Class
Have a project selected in Solution Explorer. On the Project menu, click Properties.
Click the Application tab.
Make sure the Enable application framework check box is not checked.
Modify the value in the Startup object box.
The following code compiles T2.vb
and T3.vb
, specifying that the Sub Main
procedure will be found in the Test2
class.
vbc t2.vb t3.vb -main:Test2
.NET maklum balas
.NET ialah projek sumber terbuka. Pilih pautan untuk memberikan maklum balas:
Peristiwa
17 Mac, 9 PTG - 21 Mac, 10 PG
Sertai siri perjumpaan untuk membina penyelesaian AI berskala berdasarkan kes penggunaan dunia sebenar dengan rakan pembangun dan pakar.
Daftar sekarang