Total members 9951 | Gratitudes |It is currently Sat Feb 11, 2012 9:55 am Login / Join Codemiles


All times are UTC [ DST ]




Post new topic Reply to topic  Quick reply  [ 2 posts ] 
Author Code Snippet
 Code subject: First Application in c#
PostPosted: Wed Jul 01, 2009 9:31 pm 
Offline
Newbie
User avatar

Joined: Wed Jul 01, 2009 8:19 pm
Posts: 2
Has thanked: 0 time
Have thanks: 0 time

Hello every one let's start
Here we will write our first application in c# this is a sample application as console application
It's very easy app
Please open new project as C# console application now we will write hello world application in c#
When u open it u will see this:

Code:
using System;           // this is the default namespaces written in code
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace HelloWorld          // HelloWorld this is the name of the class
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Hello World");        // message that printed in command prompt screen or black screen
        }
    }
}

Please When U run the project Run it as Start Without debuging mode to see What u Write

Let's see the command prompt Write Hello World

What if u want to enter any thing and then print it on screen
Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace HelloWorld
{
    class Program
    {
        static void Main(string[] args)
        {
            String str = "";
            Console.WriteLine("Please Enter Your Name: ");
            str=Console.ReadLine();
            Console.WriteLine("Hello : {0}",str);
        }
    }
}


Please Note That C# Language is a case sensetive language that's mean Sam not sam Not SaM
In second code we use String AS a data type String str mean create location in memory to whole text buffer only
The all Names in c# is:

abstract const extern int out short typeof
as continue false interface override sizeof uint
base
decimal
finally
internal
params
stackalloc
ulong

bool
default
fixed is
private
static
unchecked
break
delegate
float
lock
protected
string
unsafe

byte
do
for
long
public
struct
ushort

case
double
foreach
namespace
readonly
switch
using

catch
else
goto
new
ref
this
virtual

char
enum
if
null
return
throw
void

checked
event
implicit
object
sbyte
true
volatile
class
explicit
in
operator
sealed
try
while


Besides these keywords, C# has other words that should be reserved only depending on how and where they are used. These are referred to as contextual keywords and they are:
get
partial
set
value
where
yield

In second lesson I will show in details what is data types in C# and what is array, functions, classes and write sample on it
revualt


TOP
 Profile Send private message  
Reply with quote  
 Code subject: Re: First Application in c#
PostPosted: Wed Sep 22, 2010 1:11 pm 
Offline
Newbie
User avatar

Joined: Tue Sep 07, 2010 9:18 am
Posts: 30
Has thanked: 0 time
Have thanks: 1 time
I still remember when i started learning C# this was the very first program...:wink:

So enjoy guyz....lotz more to come for you.... :yahoo:

_________________
Robinetterie industrielle


TOP
 Profile Send private message  
Reply with quote  
Post new topic Reply to topic Quick reply  [ 2 posts ] 
Quick reply


  


 Similar topics
 Topic title   Forum   Author   Comments 
 Ajax Source code to Suggest application with JSP Server side  AJAX  msi_333  5
 I need chat application using php  PHP  Anonymous  0
 creating application  Java  Anonymous  0
 want to develop an application of my own  Java  Anonymous  1
 Application for the post of Network Admin.  Job Opportunities  Anonymous  0

All times are UTC [ DST ]


Users browsing similar codes

Users browsing this forum: No registered users and 1 guest



Jump to:  
Previous Code Snippet | Next Code Snippet 




Home
General Talks
Finished Projects
Code Library
Games
Tutorials

Java
C/C++
C-sharp
php
Script
JSP/Servlets
Ajax
ASP/ASP.net
Google SEO
Database
Communications
Phpbb3 styles
Photoshop tutorials
Flash tutorials
Find a job






Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All copyrights reserved to codemiles.com 2007-2011
mileX v1.0 designed by codemiles team