Go Back   TechArena Community > ARENA > Guides & Tutorials
Become a Member!
Forgot your username/password?
Register Tags Active Topics RSS Search Mark Forums Read SiteMap

Tags:

C# For Beginners

Guides & Tutorials


Reply
 
Thread Tools Search this Thread
  #1  
Old 24-12-2008
Member
 
Join Date: Aug 2008
Posts: 52
C# For Beginners

C#, pronounced c sharp, is a computer language used to give instructions that tell the computer what to do, how to do it, and when to do it. This is a universal language that is used on many operating systems , including Microsoft Windows. C# is one of the languages used in the Microsoft .NET Framework. The Microsoft .NET Framework is a library of objects that create or draw things on the computer.

The C# language is used to create applications that display on a black window referred to as the DOS prompt or DOS window.

You should first open a DOS command shell. (If you don't know what it is, clic on the Start menu then run (at the bottom) and type, in the text field: "cmd".
exercise: there is an easiest way to do that, try to find it.)
You should begin to work in an empty directory for this. let call it "C:\learncs". Type in the shell:

Code:
> md C:\learncs
> cd C:\learncs
> C:
Now you should create your first C# program, type "notepad hello.cs" and type (in the notepad)

Code:
using System;
  
    public class Hello
    {
        public static void Main()
        {
            Console.WriteLine("Hello C# World :-)");
        }
    }
the using keyword just let you write Console at line 7, instead of System.Console. It's very usefull shortcut when you use a lot of "class" define in System.
Save the file.
Now you could compile. Type in the DOS Shell again and type:
csc /nologo /out:hello.exe hello.cs

You probaly have some errors, correct them, compile again, and now you have a working hello.exe program... type hello, see...
Reply With Quote
  #2  
Old 24-12-2008
kex's Avatar
kex kex is offline
Member
 
Join Date: May 2008
Posts: 151
Re: C# For Beginners

  • uses the namespace System
  • entry point must be called Main
  • output goes to the console
  • file name and class name need notbe identical

Structure of C# ProgramsProgrammFile
  • If no namespace is specified => anonymous default namespace
  • Namespaces may also contain structs, interfaces, delegates and enums
  • Namespace may be "reopened" in other files
  • Simplest case: single class, single file, default namespace

Reply With Quote
Reply

  TechArena Community > ARENA > Guides & Tutorials


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Similar Threads for: "C# For Beginners"
Thread Thread Starter Forum Replies Last Post
Tracking Status for beginners tdemelle Microsoft Project 9 02-09-2009 11:50 AM
Aeromodelling for Beginners hellfire Off Topic Chat 18 14-08-2009 07:41 PM
I need java tutorial for beginners LetsJava Software Development 3 30-07-2009 12:01 AM
Pascal language for beginners Abaan Software Development 3 07-01-2009 12:21 PM
Learning C for beginners Paul Tips & Tweaks 2 23-05-2008 01:58 AM


All times are GMT +5.5. The time now is 04:54 PM.