eHow launches Android app: Get the best of eHow on the go.

How To

How to Learn VB or C#

Contributor
By Jackson Lewis
eHow Contributing Writer
(0 Ratings)

C# is an object-oriented programming language originally developed by Microsoft for the .NET framework. Now an international recommended standard, C# is a general purpose programming language that is similar in function to Java. C# provides greater functionality than Visual Basic for complex, component-based programming tasks to function in the .NET framework. Visual Basic enables the programmer to conduct client-side programming without the overhead of the .NET framework, but can be integrated with C#-based components for advanced programming projects. Programming "Hello World" in C# is the first major step in learning the programming language.

Difficulty: Moderate
Instructions
  1. Step 1

    Download and install the Microsoft standard development package from the uniform resource locator (URL) located in the resources.

  2. Step 2

    Open your text editor and click File, then New to start a new document. Save the file as HelloWorld.cs.

  3. Step 3

    Type the following code at the beginning of the text document:
    using System;
    using System.Windows.Forms;
    /* The "using System" statement in a C# program makes use of the C# System namespace and "System.Windows.Forms" uses the Form namespace to display "Hello World" on a message dialogue to the user in a later step in the program. */

  4. Step 4

    Add to the C# file the following code:

    class Hello
    {
    static void Main()
    {
    MessageBox.Show("Hello World");
    }
    }
    /*
    The MessageBox.Show method will display the text contained in the statement to the system alert generated by the MessageBox.Show method. */

  5. Step 5

    Open the command line prompt on your computer by clicking Start, then Run and typing command in the text field. Type cd c:\csharpe and press Enter. Type csc HelloWorld.cs and press Enter.

  6. Step 6

    At the command prompt, type HelloWorld.exe and press Enter to run your first C# program.

Subscribe

Post a Comment

Post a Comment

Related Ads

  • Have you done this? Click here to let us know.
I Did This
Get Free Computers Newsletters

Copyright © 1999-2010 eHow, Inc. Use of this web site constitutes acceptance of the eHow Terms of Use and Privacy Policy .   en-US Portions of this page are modifications based on work created and shared by Google and used according to terms described in the Creative Commons 3.0 Attribution License. † requires javascript

eHow Computers
eHow_eHow Technology and Electronics