How do i compile and run my vb.net windows application teset from comand prompt?

lusty_learner

New member
Joined
Jan 6, 2005
Messages
1
Location
Detroit
Programming Experience
3-5
Hi there,
I am a new bee to the VB.NET. I just opened Visual studio and created a console type application and put the following code in Module

Module Module1
Sub Main()
PrintPay(2,3)
End Sub

sub PrintPay(ByVal hour as double, ByVal wage as Double)
Console.Writeln("The total amoun is {0:c}" , hour*wage)
'i was just wanted to stop the command window after displaying the result 'but not sure what command to use
End Sub
End Module

The above code works and displays the result. I am fine with that but just know how to stop the command window from disappearing. I just can't see the result in the window its just gone.

Now Question:
Can not I just write this code in a note pad or text pad and use the commands that i need to to run this sample code from command prompt? I mean like java?

Also please help how to stop the command window from disappearing.
thanks
-D
 

TPM

Well-known member
Joined
Dec 7, 2004
Messages
623
Location
CA
Programming Experience
3-5
Sub Main()
PrintPay(2,3)
console.readline
End Sub

this will stop it form closing (hit enter to finish)
 

thomaskmat

New member
Joined
Jan 6, 2005
Messages
2
Programming Experience
1-3
Both Questions can be Solved By This Solutions

1. After calling all the methods in Main just write a command
Console.Read() . This command allows the screen to wait and display the result.

2. You can open the Visual studio.net command prompt from the Start Menu.
Move to the directory whrere you create your Program. Compile it Using
vbc filename.vb . And Execute it with FileName .

Example
vbc first.vb -- To compile
first --To execute
 
Top Bottom