This is my first tutorial I've ever made. And I'm so sorry if my english's not so good.
In this tutorial I want to share how to make a VB.Net Application without installing any Visual Studio. The only things you need are :
1. Installing Microsoft .Net Framework on your comp. You can freely download it from here
2. Notepad or other Text Editor
3. Command Prompt
And the important thing is all above things are free.
In this tutorial we'll make a Console Application (I'll tell you how to make a Windows Form Application in the next tutorial).
First of all (I assumed that you've installed the .Net Framework) open the Notepad by clicking Start -> Run -> Type Notepad. Then notepad application will be displayed. Then type this code below :
Public Class Student
Private _ID As String = ""
Private _Name As String = ""
Public Property StudentID As String
Get
Return _ID
End Get
Set(ByVal value As String)
_ID = value
End Set
End Property
Public Property StudentName As String
Get
Return _Name
End Get
Set(ByVal value As String)
_Name = value
End Set
End Property
End Class
Then save the file with ".vb" extension. I saved the file With FileName = Student.vb, and ensure you choose Save As Type = AllFiles. In this case I save the file in Folder D:\App.
Then create a new file by press Ctrl+N. We'll create the Sub Main of the application. Sub Main is the main procedure which is the starting point of your application. So, everything you've typed here would be read, compile and execute by the compiler, at startup application, before the others. Type this below code to make the Sub Main :
Public Module MyApplication
Public Sub Main()
dim i As Integer = 0
System.Console.Write("Enter Number of Students You Want to input :")
i = System.Console.Readline()
dim Students(i-1) As Student
For j As Integer = 0 To i-1
System.Console.WriteLine(String.Format("Enter The Info Of Student No-{0} :", J+1))
Students(j) = New Student
System.Console.Write("Student ID = ")
Students(j).StudentID = System.Console.Readline()
System.Console.Write("Student Name = ")
Students(j).StudentName = System.Console.Readline()
System.Console.WriteLine("___________________________________")
Next
Dim Answer As String = "Y"
Do
System.Console.Write("Do you want to print the data(s) you've added (Y/N):")
Answer = System.Console.ReadLine()
Loop Until Answer.ToUpper() = "Y" Or Answer.ToUpper() = "N"
System.Console.WriteLine()
If Answer.ToUpper() = "Y" then
System.Console.WriteLine("No ID Name")
For j As Integer = 0 To i-1
Dim No As Integer = J + 1
System.Console.WriteLine(No.ToString.PadRight(5) & Students(j).StudentID.PadRight(15) & Students(j).StudentName)
Next
End If
End Sub
End Module
Then save the file with ".vb" extension like Student.vb file above. I saved the file With FileName = MyConsole.vb, and ensure you choose Save As Type = AllFiles. In this case I save the file in the same Folder with Student.vb "D:\App".
After you finished, open the Command Prompt by clicking Start -> Run -> type cmd then press Enter.
When the Command Prompt's displayed, write down this below code to set the Work Path to be the same where .Net Framework was installed. By default it'll be installed in Folder "C:\Windows\Microsoft.Net\Framework\Vxxxx". Vxxxx is the version of your .Net Framework. In this tutorial I used .Net Framework v4.0, but it'd be running well on the other version.
path=%path%;c:\windows\microsoft.net\framework\v4.0.30319
Then change your directory into the Folder where you saved the File by type this code :
CD /D D:\App
And now it's time to compile it, just write down this code :
VBC /OUT:MyConsoleApplication /T:exe MyConsole.vb Student.vb
The explain :
VBC : the VB Command Line Compiler application.
Parameter /OUT : to set your application name.
Parameter /T : to set the target of your application type. Exe = Console Applicatio. Winexe = Windows Application
MyConsole.vb and Student.vb are the files we've made. Don't forget to type ".vb".
Then run your application by calling the name's of your application.
MyConsoleApplication.exe
Or just :
MyConsoleApplication
Hope it's clear for you all guys.






MultiQuote







|