C# Corner: C# and .NET Developer's Network
All Source Code
ADO.NET
Exception
Handling
General
GDI+
Internet
Mobiling
Multithreading
Networking
Printing
Security
Strings & Arrays
Windows Forms
WebForms
XML.NET
Articles
Effective C#
FAQ
How do I
Learn C#
Tutorials
C# Beginners
Introduction to C#
First day with C#. This part of tutorial explains what is C#, how to install it, how to
write your first program, compile and run it.
Working with Data Types
Explains data types in C# and how to work with them.
Control Statements: Part 1 By Amisha Mehta
This lesson shows how to use c# control statements, and the difference between
these controls in c++/ JAVA and c#. Sample includes single selection, if-else, and
multi case ..
Control Statements: Part 2 By Amisha Mehta
This lesson shows how to use while..do, for, for..each statements
Language Preprocessor Directives By Vivek Gupta
Control Statements: Part 1
Control Statements: Part 2
Constructors and Destructors
Properties in C#
Exception Handling
Using Attributes in C#
Properties in C#: New cover on old book by Vivek Gupta
Namespaces
Properties are accessor methods whose job it is to retrieve and set the values of
fields.
Exceptions in C# provide a structured, and type-safe way of handling both system
level and application level error conditions. The exception mechanism in C# is very
similar to that of C++
What & Why? Properties: Part 1 by Rahul Sharma
If you were programming in C or C++ before coming to C#, you'll be a little bit
confused about properties.
In the part 1 of this series, I discussed about the get method of the properties, with
the help of which you can make your variable so that nobody can modify the value of
the variable
Difference using Directive and Statement by Yoganand Aiyadurai
This article explains difference between using directive and using statement with
sample example.
C# and its Types by G. Gnana Arun Ganesh
COBOL.NET
Eiffel.NET
FoxPro.NET
JScript .NET
Learn XML
Mobile & SOAP
My Services
Open Source
VBScript .NET
VC++.NET
Visual J#
Visual Studio.NET
C# and its Types
Encapsulation in C#
What & Why? Properties: Part 2 by Rahul Sharma
Source Code
Articles
FAQ
Learn ASP.NET
Tutorials
Working with Data Types
This lesson contains C# language preprocessor directrives including #if, #else,
#define, #undef, #line etc with sample examples..
Exception Handling By Amisha Mehta
Source Code
Articles
FAQ
Learn VB.NET
Tutorials
Introduction to C#
A detailed tutorial and C# types such as Value and Reference types with sample
examples.
Events and Delegates By Kunal Cheda
Events in C# are based on delegates, the Originator defining one or more callback
functions
for..each: A C# Syntax which Java lacks by Ashish Banerjee
C# has a new iteration syntax called foreach, which I believe has been inherited
from Visual Basic ( correct me if I am wrong).
C# and its features by G. Gnana Arun Ganesh
C# is a modern, type safe programming language, object oriented language that
enables programmers to quickly and easily build solutions for the microsoft .NET
platform
Boxing and Unboxing by G. Gnana Arun Ganesh
Boxing and unboxing is a essential concept in C#’s type system. With Boxing and
unboxing one can link between value-types and reference-types
(1 of 4) [11/27/2001 7:17:40 PM]
Exploring Delegates
C# Corner: C# and .NET Developer's Network
About Us
Books
Book Chapters
Career Center
Discussion
Downloads
Events
Hosting
Links
Magazines
Members
News Letter
Sponsors
Training
Tools
Jobs
Join C# Corner
Our Partners
Submit Code
Win Prizes
Understanding and Implementing Namepsaces in C# by G. Gnana
Arun Ganesh
Namespaces allow you to create a system to organize your code. A good way to
organize your namespaces is via a hierarchical system.
Operator Overloading in C# by Prasad H.
The Source code below shows how to use OperatorOverloading in C#. Operator
Overloading is pretty useful concept derived from C++ by C#.
Using Attributes in C# by Rajadurai P.
This article shows how to create custom attribute classes, use them in code, and
query them.
Using Array class and IEnumeration by Rajadurai P.
This article illustrates the usage of Array class and IEnumerator. Array class Provides
methods for creating, manipulating, searching and sorting arrays, thereby serving as
the base class for all arrays in the common language runtime.
Enumerators in C# by Prasad H.
Sample example shows you how to use enumerators in C#.
Visual Inheritance in C# by Prasad H.
Mindcracker
We all know that Inheritance means a extending a class with more Features without
worrying about the implementation of features of hidden inside the class to be
inherited.
Visual Inheritance Part 2 by Prasad H.
We all know that Inheritance means a extending a class with more Features without
worrying about the implementation of features of hidden inside the class to be
inherited.
Abstract Classes and Methods by Rajesh V.S.
This is a detailed analysis of Abstract classes and methods in C# with some concrete
examples.
Constructors and Destructors by Rajesh V.S.
This detailed article talks about how constructors and destructors work in C# and
how to use them in your applications.
Encapsulation in C# G. G. Arun Ganesh
In Object Oriented programming Encapsulation is the first pace. Encapsulation is the
procedure of covering up of data and functions into a single unit (called class).
Method Parameters in C# G. G. Arun Ganesh
This article describes different method parameters such as value parameters,
reference parameters, output parameters, and parameter arrays.
Understanding Properties in C# Rajesh V.S.
In C#, properties are nothing but natural extension of data fields. They are usually
known as ‘smart fields’ in C# community.
Understanding Structures in C# Rajesh V.S.
A structure in C# is simply a composite data type consisting of a number elements of
other types.
Understanding Enumerators in C# Rajesh V.S.
An enumeration (enum) is a special form of value type, which inherits from
System.Enum and supplies alternate names for the values of an underlying primitive
type.
Inheritance and Polymorphism
Rajesh V. S.
By using the concept of inheritance, it is possible to create a new class from an
existing one and add new features to it.
Exploring Delegates
By Filip Bulovic
Delegates are a kind of type safe function pointers which are actually declared as
class derived from System.MulticastDelegate.
BitWise Operations in C#
By Chandra Hundigam
C# has lots of flexibility over manipulating with bits. Before I start explaining about
bit wise manipulation I would like to give some inputs on binary operations.
(2 of 4) [11/27/2001 7:17:40 PM]
C# Corner: C# and .NET Developer's Network
Pointers in C#
Rajesh V. S.
C# also supports pointers in a limited extent. A pointer is nothing but a variable that
holds the memory address of another type. But in C# pointer can only be declared to
hold the memory address of value types and arrays.
Implementing Stacks in C#
Danish Sami
With the help of C# we can also implement ADT (Abstract Data Types) with little
effort. An example of ADT is a simple stack of integers.
Working with Namespaces in C#
Rajesh V. S.
In C#, namespaces are used to logically arrange classes, structs, interfaces, enums
and delegates. The namespaces in C# can be nested. That means one namespace
can contain other namespaces also.
Passing const parameters in C#, C++, and VB.NET by Bulent Ozkir
Parameter passing to a function is extremely important in all programming languages.
The desire to keep the passed parameter intact forced the compiler designers to add
various keywords to
Multiple inheritance in C# by Craig Breakspear
Can you inherit from multiple classes in C#? Simply put, this cannot be done. However
there are ways around it. From a design perspective you must ask yourself, Will a
Class fully represent an object?
Interface Component Interoperability by G. Gnana Arun Ganesh
The fundamental concept behind both COM and DCOM is the interface. An interface is
an agreement between a client and an object about how they will communicate with
each other.
Difference between const and readonly
The sample example shows the difference between const and readonly Submitted by
Say Gin
C# Language changes from .NET Beta 1 to .NET Beta 2
This article contains C# language changes from Beta 1 to Beta 2. Submitted by Vivek
Gupta. Source MSDN documentation.
Using out and ref parameters By Kunal Cheda
When we pass a parameter as ref to a method, the method refers to the same variable
and changes made will affect the actual variable.
The out and ref parameters
The out and the ref parameters are used to return values in the same variables, that
you pass an an argument of a method. These both parameters are very useful when
your method needs to return more than one values.
Serializing Objects in C#
In simple words serialization is a process of storing the object instance to a disk file.
Serialization stores state of the objecti.e. member variable values to disk.
Deserialization is reverse of serialization i.e.
Operator Overloading Example by Prasad
The code uses the feature of Operator Overloading in C#. It shows how different
operators are overloaded and can be used in a easy manner.
Regular Expressions Example by Prasad
The following example shows the use of Regular Expresssions in C#.This program has
basic validation scripts for validation easily useable in all programs.
.
contact:
copyright © 2000 c-sharpcorner.com. All rights are reserved. See terms and condition to use this site and its contents.
(3 of 4) [11/27/2001 7:17:40 PM]
C# Corner: C# and .NET Developer's Network
Sponsors: devexpress microgold apress
(4 of 4) [11/27/2001 7:17:40 PM]
C# Corner: C# and .NET Developer's Network
Introduction to C#
All Source Code
ADO.NET
Exception
Handling
General
GDI+
Internet
Mobiling
Multithreading
Networking
Printing
Security
Strings & Arrays
Windows Forms
WebForms
XML.NET
Articles
Effective C#
FAQ
How do I
Learn C#
Tutorials
This part of tutorial explains about C# and how to write and compile your first C# program from
command line.
What is C#?
C# is a new programming language developed by Microsoft. C# has power of C++ since it's
derived from C and C++. It is simpler as VB. Besides that, C# is a Java like language for web
programming and it has some good features of Delphi too. Microsoft says, that C# is the best
language to develop its .NET Framework applications.
Installing .NET SDK
Installing .NET SDK is first step to run C# on your machine. You can install .NET SDK on Windows
ME, Windows NT, or Windows 2000. But Windows 2000 is recommended. After selecting your OS,
you need to follow these steps:
●
●
●
Source Code
Articles
FAQ
Learn VB.NET
Tutorials
Source Code
Articles
FAQ
Learn ASP.NET
Tutorials
COBOL.NET
Eiffel.NET
FoxPro.NET
JScript .NET
Learn XML
Mobile & SOAP
My Services
Open Source
VBScript .NET
VC++.NET
Visual J#
Visual Studio.NET
Install IE 5.5
Install Microsoft .NET Framework SDK. It's free and you can download it here. NET
Framework SDK.
After installing these you can write your code in any text editor and save it as .cs
extension. Type this in an notepad and save as my.cs.
C# Compiler and Editors
.NET SDK Beta 1 release of Microsoft's new platform, .NET, incorporated with C# command line
compiler. You must have to install .NET SDK to run a C# program. Once you install .NET SDK,
you can write your C# program in any text editor including notepad, wordpad or Visual Studio.
There are some third party editors are available in the market too. Some of them are free. Check
out tools section of C# Corner.
Write your first C# program
Writing your first C# program is similar to writing C++ applications. You open any text editor, I
described in the above paragraph and type this code.
using System;
class MyClass
{
static void Main() {
Console.WriteLine("Hello World!");
}
}
Compile your first C# program
Now use command line to compile your cs file. C# compiler takes at least one argument i.e., file
name. Say your C# file name is myclass.cs then here is command line syntax.
csc myclass.cs
C# compiler creates an exe file in the bin dir of your project. Just run this exe
and see the output.
(1 of 2) [11/27/2001 7:19:46 PM]
C# Corner: C# and .NET Developer's Network
All Source Code
ADO.NET
Exception
Handling
General
GDI+
Internet
Mobiling
Multithreading
Networking
Printing
Security
Strings & Arrays
Windows Forms
WebForms
XML.NET
Articles
Effective C#
FAQ
How do I
Learn C#
Tutorials
BY USING C-SHARP CORNER (C# Corner, the "Site" or We or Us) YOU ACCEPT AND WILL BE
BOUND BY THE TERMS AND CONDITIONS. THESE TERMS AND CONDITIONS MAY BE UPDATED
FROM TIME TO TIME.
PLEASE READ THESE TERMS AND CONDITIONS CAREFULLY BEFORE ACCESSING OR USING THE
SITE. BY ACCESSING OR USING THE SITE, YOU AGREE TO BE BOUND BY THE TERMS AND
CONDITIONS SET FORTH BELOW. IF YOU DO NOT WISH TO BE BOUND BY THESE TERMS AND
CONDITIONS, YOU MAY NOT ACCESS OR USE THE SITE.
Copyright, Licenses and Idea Submissions.
Domestic and International copyright and trademark laws protect the entire contents of the Site.
The articles and code on the site is copyright of the author and rest every thing is copyright of the
site. YOU MAY READ, PRINT, DOWNLOAD, MODIFY THE DOWNLOADED MATERIAL FOR YOUR OWN
NON-COMMERCIAL USE. HOWEVER YOU MAY NOT MODIFY, COPY, REPRODUCE, REPUBLISH,
UPLOAD, POST, TRANSMIT, OR DISTRIBUTE, IN ANY MANNER, THE MATERIAL ON THE SITE,
INCLUDING TEXT, GRAPHICS, SOURCE CODE FOR COMMERCIAL USE WITHOUT PRIOR WRITTEN
PERMISSION OF THE SITE..
By using the site, you also agree not to remove any any author's or the site's copyright information
from any material you wish to use.
Source Code
Articles
FAQ
Learn VB.NET
Tutorials
Source Code
Articles
FAQ
Learn ASP.NET
Tutorials
Use of the Site.
C# Corner is a free resource online community. Any body can share their code, articles, tips or
other related material on the site. Use the site on your own risk. C# Corner does not guarantee or
warrant accuracy and reliability of data and information published on the site. The site also doesn't
take responsibility of infected files or source code with any kind of infection or viruses, worms,
Trojan horses.
To use the site, you agree you will not:
■
■
COBOL.NET
Eiffel.NET
FoxPro.NET
JScript .NET
Learn XML
Mobile & SOAP
My Services
Open Source
VBScript .NET
VC++.NET
Visual J#
Visual Studio.NET
■
■
■
■
■
■
Post any information, data, text, or images, or other material that is unlawful, harmful,
threatening, abusive, harassing, vulgar, obscene, libelous, or otherwise objectionable that
may invade another's right of privacy or publicity;
Post any Material that you do not have a right to reproduce. If you publish other authors
work, you must have a written permission of the author of that material.
Delete any author attributions, legal notices or proprietary designations or labels that you
upload to any communication feature;
Upload any material copyright, trademark, patent, or proprietary rights of any third party.
Post any material, which can harm our visitors or authors.
Use our author's or members emails (published on their request in their profile) to send junk
mail, Spam, or chain letters or without their permission,
Violate any applicable local, state, national or international law,
Post any information or images on discussion forums that may harm any body by any means
or unlawful, harmful, threatening, abusive, harassing, vulgar, obscene, libelous, or otherwise
objectionable that may invade another's right of privacy or publicity.
Authors
As an authors, you agree that the site visitors are free to use your code or article for their
reference and can use the code in their own programs freely and without restriction (UNLESS YOU
HAVE THE PERMISSION IN YOUR CODE ITSELF) and may distribute compiled versions of the code
freely and without restriction. By submitting your article or source code, you agree that you are the
original owner (UNLESS YOU SPECIFY THE REFERENCES AND HAVE A WRITTEN PERMISSION OF
THE ORIGINAL AUTHOR) of the article or code or otherwise has the right to redistribute it freely.
(1 of 2) [11/27/2001 8:25:08 PM]
C# Corner: C# and .NET Developer's Network
About Us
Books
Book Chapters
Career Center
Discussion
Downloads
Events
Hosting
Links
Magazines
Members
News Letter
Sponsors
Training
Tools
Jobs
Join C# Corner
Our Partners
Submit Code
Win Prizes
C# Corner takes no responsibility, no liability for disputes regarding ownership, copyright, or
trademarks of the code uploaded to this site. However, by submitting your article or source code,
you grant to C# Corner, a nonexclusive, worldwide license to link to, reproduce, distribute, adapt,
perform, display and sublicense the submitted code or content with your permission.
C# Corner reserves the right to reject any submission, to alter submissions, and to remove a
submission from the site that had previously been posted at any time without any previous
notification. However once published article or code may not be removed from the site.
Contest and Prizes
Winners of contest and prizes are selected based on the article/code contents, usefulness,
downloads, readers feedback, judges decision and other factors. C# Corner reserves all the rights
to determine which entries are winners as well as to cancel the contest or prizes without any prior
notice. C# Corner will try to send winner prizes as soon as possible. Winners are responsible to
send their address within a week. We take no time guarantee outside of US as we have no control
on the posting service outside the US.
DISCLAIMER
Mindcracker
IN NO EVENT WILL C# CORNER BE RESPONSIBLE FOR ANY INCIDENTAL, CONSEQUENTIAL,
DIRECT OR INDIRECT DAMAGES, OR OTHER LOSSES FOR ANY USE OF THE SITE, ITS MEMBERS
SITES, OR LINKS TO THIRD PARTY SITES INCLUDING ANY LOST PROFITS, BUSINESS LOSSES,
DATA LOSSES, OR ANY PROPERTY LOSSES.
THE CONTENTS OF THE SITE MAY BE SUBJECT TO CHANGE OR UPDATE WITHOUT ANY PRIOR
NOTICE. WE DO NOT TAKE RESPONSIBILITY OF THE ACCURACY OR REDUNDANCY, OR
ORIGINALITY OF THE MATERIAL OR ANY CONTENTS INCLUDING TEXT, GRAPHICS, CODE, OR
OTHER MATERIAL, ON THE SITE.
Links to third party sites
Third party site links on this site are only for your convenience and we have no responsibility and control
on third party links. If any link is misleading or changed or removed, we are not responsible for that.
TRADEMARKS
Microsoft, Windows, Windows NT, VC++, Visual Studio, .NET, VB, Visual C#, FrontPage, Windows Media
other Microsoft products referenced on this site are registered trademarks of Microsoft Corporation.
Linux is a registered trademark of Linus Torvalds. Jini, Java, and JavaScript are trademarks of Sun
Microsystems, Inc.
Other product and company names mentioned herein may be the trademarks of their respective owners.
Copyright Notice
Copyright © 2001 C# Corner and its authors. All rights reserved. Permission to use C# Corner contents
may be granted only after receiving a written request to do so.
contact:
copyright © 2000 c-sharpcorner.com. All rights are reserved. See terms and condition to use this site and its contents.
Sponsors: devexpress microgold apress
(2 of 2) [11/27/2001 8:25:08 PM]