Page 1 of 1

VB.Net Programming Using Notepad And Command Prompt (Part I) Building Console Application Rate Topic: ***** 1 Votes

#1 emresutisna  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 21
  • View blog
  • Posts: 80
  • Joined: 14-May 09

Posted 09 September 2010 - 10:36 AM

Hi, all.
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.

Is This A Good Question/Topic? 4
  • +

Replies To: VB.Net Programming Using Notepad And Command Prompt (Part I)

#2 MistGun  Icon User is offline

  • New D.I.C Head
  • member icon

Reputation: 3
  • View blog
  • Posts: 23
  • Joined: 27-October 10

Posted 28 October 2010 - 02:00 PM

Nice tutorial bro! but you can use this method only with simple applications.
Was This Post Helpful? 0
  • +
  • -

#3 emresutisna  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 21
  • View blog
  • Posts: 80
  • Joined: 14-May 09

Posted 29 October 2010 - 07:26 AM

View PostMistGun, on 28 October 2010 - 01:00 PM, said:

Nice tutorial bro! but you can use this method only with simple applications.

Hi, MistGun. You can use this method to make a Windows Forms Application too. I'll tell you how to make it in my Next Tutorial.
:bigsmile:
Was This Post Helpful? 0
  • +
  • -

#4 MistGun  Icon User is offline

  • New D.I.C Head
  • member icon

Reputation: 3
  • View blog
  • Posts: 23
  • Joined: 27-October 10

Posted 29 October 2010 - 07:52 AM

View Postemresutisna, on 29 October 2010 - 06:26 AM, said:

Hi, MistGun. You can use this method to make a Windows Forms Application too. I'll tell you how to make it in my Next Tutorial.
:bigsmile:


That would be great, I'll be waiting for you next tutorial man.
Thank you for your contribution!

Was This Post Helpful? 0
  • +
  • -

#5 nileshkantak  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 05-September 07

Posted 12 April 2011 - 12:02 AM

Thank you. Very nice ..
Was This Post Helpful? 0
  • +
  • -

#6 ???  Icon User is offline

  • New D.I.C Head

Reputation: 3
  • View blog
  • Posts: 48
  • Joined: 25-November 10

Posted 31 May 2011 - 12:51 PM

Hey will .NET Framework 4.0 need to be installed for a .NET 4.0 app to work?
Was This Post Helpful? 0
  • +
  • -

#7 AdamSpeight2008  Icon User is offline

  • MrCupOfT
  • member icon


Reputation: 2250
  • View blog
  • Posts: 9,432
  • Joined: 29-May 08

Posted 31 May 2011 - 01:07 PM

???: Yep

This post has been edited by AdamSpeight2008: 31 May 2011 - 01:08 PM

Was This Post Helpful? 1
  • +
  • -

#8 ???  Icon User is offline

  • New D.I.C Head

Reputation: 3
  • View blog
  • Posts: 48
  • Joined: 25-November 10

Posted 01 June 2011 - 07:20 AM

Yeah I figured.
Was This Post Helpful? 0
  • +
  • -

#9 TechKid  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 3
  • View blog
  • Posts: 82
  • Joined: 04-September 10

Posted 25 November 2012 - 09:50 AM

Great tutorial, I think i might need to use this one day. ;)
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1