Total members 11807 |It is currently Wed Dec 11, 2019 1:24 am Login / Join Codemiles

Java

C/C++

PHP

C#

HTML

CSS

ASP

Javascript

JQuery

AJAX

XSD

Python

Matlab

R Scripts

Weka





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:

csharp 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
csharp 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 sensitive 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:
Code:
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:
Code:
get
partial
set
value
where
yield





Author:
Newbie
User avatar Posts: 2
Have thanks: 0 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:



Author:
Newbie
User avatar Posts: 27
Have thanks: 1 time
Post new topic Reply to topic  [ 2 posts ] 

  Related Posts  to : First Application in c#
 Connecting Java Application to C++ Application from Code     -  
 My First Ajax application     -  
 want to develop an application of my own     -  
 Mobile Application     -  
 I need chat application using php     -  
 About Mobile application     -  
 Open other application from java     -  
 Controlling Web Application Behavior with web.xml     -  
 Which language is required to set up a web application?     -  
 GUI for video capturing application     -  



Topic Tags

C# Basics






Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All copyrights reserved to codemiles.com 2007-2011
mileX v1.0 designed by codemiles team
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com