Jump to content


Check out our Community Blogs

Register and join over 40,000 other developers!


Recent Status Updates

View All Updates

Photo
- - - - -

Visual Basic Console Program

hello world console

  • Please log in to reply
6 replies to this topic

#1 shivam

shivam

    CC Regular

  • Just Joined
  • PipPipPip
  • 25 posts

Posted 24 February 2011 - 06:08 AM

I want to know how to run a Console Program in VB Like JAVA..What is the Default Folder in vb like jdk/bin in JAVA and how to set the Environment Path in vb ??

Please Help..!!!!

Example Code:

Imports System
Module Module1
Sub Main()
Console.WriteLine("Hello World!")
End Sub
End Module
  • 0

#2 CommittedC0der

CommittedC0der

    CC Leader

  • Expert Member
  • PipPipPipPipPipPipPip
  • 1065 posts
  • Programming Language:C#
  • Learning:C#, JavaScript, PL/SQL

Posted 24 February 2011 - 07:02 AM

Well I assume you have Visual Studio, so just create a new VB project, and when it comes up asking you what to name your program change the project type from winForms, to console.
[ATTACH=CONFIG]3732[/ATTACH]

Good luck ~ Committed. :)

  • 0
There IS a war going on for your mind.
Nothing of eternal significance happens besides prayer.

#3 shivam

shivam

    CC Regular

  • Just Joined
  • PipPipPip
  • 25 posts

Posted 24 February 2011 - 07:07 AM

Yeah Definitely this is an option to run the Console VB Program.. But i don't want to use the Framework of Visual Studio. I just Like To use it as a JAVA Program. Simply Write in a Notepad Save it as Example.vb and run from Console cmd...
  • 0

#4 CommittedC0der

CommittedC0der

    CC Leader

  • Expert Member
  • PipPipPipPipPipPipPip
  • 1065 posts
  • Programming Language:C#
  • Learning:C#, JavaScript, PL/SQL

Posted 24 February 2011 - 07:14 AM

Why would you want to use notepad to edit code? :blink: Anyway im not sure how you would do that, I dont see anything on Google saying how. :worry:
~ Committed.
  • 1
There IS a war going on for your mind.
Nothing of eternal significance happens besides prayer.

#5 shivam

shivam

    CC Regular

  • Just Joined
  • PipPipPip
  • 25 posts

Posted 24 February 2011 - 07:20 AM

I am Reading a Book and it says that we can also run a program of vb using notepad and cmd..So i tried to do so :c-cool:well its better that i stay on the Visual Studio 2010:c-smile:

Well Thanx for advice:c-smile:
  • 0

#6 Alexander

Alexander

    YOL9!

  • Moderator
  • 3963 posts
  • Location:Vancouver, Eh!
  • Programming Language:C, Java, C++, PHP, Python, JavaScript, Perl, Delphi/Object Pascal, Visual Basic .NET, Assembly, Fortran, Bash, Others

Posted 24 February 2011 - 05:13 PM

Visual studio has a command line compiler, you can read about it here: How to: Invoke the Command-Line Compiler

I would recommend you get a proper IDE (Geany for example) and set it up so the compiler option uses vbc.exe automatically to aid in the process of building, doing it by command line manually is counterproductive.
  • 1

All new problems require investigation, and so if errors are problems, try to learn as much as you can and report back.


#7 shivam

shivam

    CC Regular

  • Just Joined
  • PipPipPip
  • 25 posts

Posted 24 February 2011 - 08:27 PM

Visual studio has a command line compiler, you can read about it here: How to: Invoke the Command-Line Compiler

I would recommend you get a proper IDE (Geany for example) and set it up so the compiler option uses vbc.exe automatically to aid in the process of building, doing it by command line manually is counterproductive.


This is what i am looking for.. thanks a ton Alexander..:c-smile:
  • 0





Also tagged with one or more of these keywords: hello world, console

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download