The Wayback Machine - https://web.archive.org/web/20061017125901/http://www.codeguru.com/csharp/csharp/cs_syntax/

CodeGuru
Earthweb Search
Forums Wireless Jars Gamelan Developer.com
CodeGuru Navigation
Member Sign In
User ID:
Password:
Remember Me:
Forgot Password?
Not a member?
Click here for more information and to register.

jobs.internet.com

internet.commerce
Partners & Affiliates
Compare Prices
Promotional Gifts
GPS
GPS
IT Jobs
IT Degrees
Greeting Cards
Boat Donations
IT Discount Club
KVM over IP
Help Desks
Executive MBA
2nd Mortgage
Tech Jobs



RSS Feeds

All

VC++/C++

.NET/C#

VB

See more EarthWeb Network feeds

Home >> .NET / C# >> C# >> Basic Syntax

Embracing the full spectrum of developer needs including content supporting 64 bit, Multi-Core, Tools, and Optimization.

Making Multi-Cores Count: An ISV Licensing Primer
On the road to concurrent programming, do customers see you as the fast laneor the speed bump? The best way for ISVs to support emerging x86-based virtualization and grid computing technologies is by moving away from antiquated hardware-based license models. Read more.
Mr. Multimedia: AMD's Wei-Lien Hsu
See how AMD's various architecture designs provide processor performance across the computing board, including formerly niche areas such as multimedia, and how passionate engineers like Wei-Lien Hsu are making it happen. Read more.
Man on a Mission: AMD's Brent Hollingsworth
AMD is working on a library of thousands of functions that will make the parallel technologies embedded in AMD's multi-core processors and other multiprocessor technologies available to developers. See what the project's team leader has to say about the challenges and benefits of the AMD Performance Library (APL). Read more.
Taking Advantage of Concurrent Programming for Windows, Part 2: Multi-Core Programming in .NET
In the coming many-core era, the performance difference between single-threaded and multithreaded applications will grow greater and greater. It behooves all professional programmers to begin coding for multiple cores now. Read more.
For more relevant code samples, tutorials and editorials click here.

Intel is software, too. Integrating hardware and software is essential for optimal design. Intel Software offers a comprehensive portfolio of software resources for your innovation. There�s more.

Basic Syntax

Anand C# Tutorials



Mobile/PocketPC Development Jump Start
Rating:
Bradley Jones - 06/22/2004
Learn to start developing for the PocketPC and other mobile devices using Visual Studio .NET 2003.

C# FAQ 1.6 - What are Identifiers and Keywords?
Rating:
Anand Narayanaswamy - 03/18/2004
Learn about Identifiers and Keywords in C#

[Updated] C# FAQ 1.5 - What is an Assembly?
Rating:
Anand Narayanaswamy - 03/09/2004
Learn about the concept of assemblies in .NET.

[Updated] C# FAQ 1.4 - How Do I Work with Namespaces?
Rating:
Anand Narayanaswamy - 03/05/2004
Learn how to apply namespaces in your C# programs.

Interacting with COM Components Using C#
Rating:
Anand Narayanaswamy - 11/15/2002
Learn about COM components and their application in C#.

Event Handling in C#
Rating:
Anand Narayanaswamy - 11/07/2002
Examine the concept of events in detail with the help of relevant examples.

Working with Files in C#
Rating:
Anand Narayanaswamy - 10/31/2002
Get practical with C# by using it to access file information, create subdirectories, and more. You'll also learn to read and write from basic files.

Exception Handling in C#
Rating:
Anand Narayanaswamy - 10/24/2002
Learn about the usage of various exception handling statements in C# with the help of relevant listings.

Working with Interfaces in C#
Rating:
Anand Narayanaswamy - 10/16/2002
Learn about the concept behind interfaces in C# with the help of relevant listings.

Working with Structures, Enumerations, and Inheritance in C#
Rating: none
Anand Narayanaswamy - 10/10/2002
Examine the concept behind Structures, Enumerations, and Inheritance in C#.

Working with Arrays in C#
Rating:
Anand Narayanaswamy - 10/02/2002
Anand continues his series of articles on C#. In this installment, learn about arrays. As a bonus, he also covers command line arguements.

Understanding Classes, Methods, and Properties in C#
Rating:
Anand Narayanaswamy - 09/27/2002
Anand discusses the basic object oriented constructs within C# -- classes.

Getting Started with C#
Rating:
Anand Narayanaswamy - 09/17/2002
In learning a new programming languages, you have to start somewhere. Anand presents both the tools needed for C# development and the legendary "hello world!" program.

C# and Intermediate Language
Rating: none
Anand Narayanaswamy - 09/04/2002
C# programs are compiled to become Intermediate Language (IL). In this article, you'll see what IL code is generated by a simple C# 'Hello World' program.

Introducing Microsoft .NET
Rating: none
Anand Narayanaswamy - 08/23/2002
Microsoft is moving forward with its .NET strategy. In this first of a series of articles on programming in C#, Anand introduces .NET and builds the foundation for .NET C# development.


Attributes



The New Lambda Expressions Feature in C# 3.0
Rating: none
Vipul Patel - 04/12/2006
C# 3.0 introduces lambda expressions, a more concise syntax for declaring method code inline where in the past you would have used a delegate function.

Converting Between MFC/C++ and .NET Types
Rating:
Tom Archer - MSFT - 07/19/2004
Converting between types is frequently a sticking point for coders new to mixing MFC and .NET. Tom Archer illustrates some basic conversions that will help you should you get stuck in a painful series of compiler error messages about type mismatches.

Eliminate a Tedious Task Through Creating Self Configuring Objects
Rating: none
Mark Strawmyer - 12/11/2002
Retrieving application settings is a pretty common task that falls under the category of another of those tedious and repetitive tasks that programmers have to deal with. Explore a way to eliminate this tedious programming task through a combination of technologies.

Using Attributes in C#
Rating:
Sadaf Alvi - 09/24/2002
Learn about attributes and how to create and attach them to various program entities within your programs. You also learn how to retrieve attribute information at run time.


Basic Syntax



[Updated] C# FAQ 1.3 - What Are the Requirements for Developing a C# Application?
Rating:
Anand Narayanaswamy - 03/04/2004
For those who may develop in C#, Anand overviews the machine requirements and more.

[Updated] C# FAQ 1.2 - What is C#?
Rating:
Anand Narayanaswamy - 03/04/2004
A quick definition of C#.

What Are Partial Types in C#?
Rating:
Bradley Jones - 07/07/2003
Partial types are a construct that Microsoft has proposed be added to C#. It is never too early to learn more.

What Are C# Generics?
Rating:
Bradley Jones - 06/30/2003
Microsoft has announced a number of changes that should occur in future C# standards. One of these changes is a template-like feature called generics.

Quick C#
Rating:
Aisha Ikram - 06/13/2003
Learn C# in less than an hour. Discover the C# language constructs and features in a brief yet comprehensive way using code examples. This article is especially good if you know C++ and feel lazy about learning C#!

Boxing and Unboxing of Value Types in C#:
Rating: none
Stuart S. Fujitani - 05/15/2002
If not fully understood, automatic boxing and unboxing can adversely affect application performance and cause unexpected, difficult-to-locate bugs. Stuart explains the concept of boxing and unboxing and their subtle behaviors.

Running Worker Thread in C#
Rating: none
Alex F - 01/29/2002
Shows how you can run a worker thread which makes synchronous calls to the user interface (for example, thread reads a long recordset and fills some control in the form).


Component Development



Bit Flags Type Converter
Rating: none
Serge Gorbenko - 06/30/2006
Learn about an implementation of TypeConverter that allows you to edit bit flags enumerations in PropertyGrid.

Components in C#
Rating:
Chandra Hundigam - 11/13/2001
How to create a component in C#.


Controls



Dynamically Displaying the Keyboard
Rating: none
Bradley Jones - 06/02/2006
Make your Pocket PC applications more intuitive by providing the input panel when it is needed and removing it when it is not.

Binding Data to WinForms Controls in VB.NET 2.0
Rating:
Paul Kimmel - 10/25/2005
Visual Studio 2005 and .NET 2.0 support binding to traditional data sources and custom objects based on the capabilities of the CodeDOM, typed DataSets, and changes to Forms designers.

MFC and .NET: Why ShellExecute Isn't Dependable and How to Work Around It
Rating:
Tom Archer - MSFT - 07/22/2004
Tom Archer explains the low-level details of why the ShellExecute function isn't dependable in a mixed-mode application. He then offers a couple of workarounds to this limitation.

Drag and Drop for Board Games
Rating:
Scott MacDiarmid - 01/23/2002
This application shows how the drag and drop features in C# could be used to create a simple board game or whatever.

Docking Control in C# That Can Be Dragged and Resized
Rating: none
Phil Wright - 11/02/2001
This article shows you to make your applications able to drag a docked control to a different edge and how to resize the control so that the application area can be cusomized to suit your preferences.


Enumerations



Converting a String to an Enumeration Value
Rating: none
Andreas Stolle - 11/13/2002
How to convert a string value to a given enumeration type using System.Reflection.


Error Handling



The Back Side of Exceptions
Rating: none
Sergei Kitaev - 08/15/2006
Learn about the risks of an exception being thrown where it is generally not expected, and ways to prevent some insidious errors.

Custom Exceptions in VB 2005
Rating: none
Josh Fitzgerald - 03/13/2006
Although the .NET Framework provides many standard exceptions, you also can create, throw, and catch your own custom exceptions. In fact, custom exception types are a powerful feature of the VB .NET language.

Protect Resources with the Using Block
Rating:
Paul Kimmel - 09/16/2005
Garbage collection does not determine when resources are collected, so it's up to you to protect classes that use finite resources that need some deterministic cleanup. Learn how the using block—a shorthand version of the try-finally block—enables you to do so.

Perform Exception Handling in .NET Exceptionally
Rating:
Mark Strawmyer - 11/10/2004
This month, .NET Nuts & Bolts covers exception handling, examining what exceptions are and why they are important. You'll learn how to use them, how to create custom exceptions, and how to apply common best practices.

Using Custom Exception Handlers to Restart Your Application
Rating:
Tom Archer - MSFT - 05/03/2004
One often-overlooked ability of .NET is that you can create a custom exception handler that will allow you to catch all unhandled exceptions thrown during the execution of your application.

What!? A .NET Application Can Die?
Rating:
John Robbins - 03/12/2003
Your applications can end sadly and abruptly. While that's fine during development, you don't want to have your applications die with an exception in front of our users. Nothing is more embarrassing than a confusing dialog or web page referring to unhandled exceptions.

Exception Handling in C#
Rating: none
Kamran Shakil - 12/11/2001
Tutorial on exception handling in C#.


Indexers



Programming with Partial Classes in VB.NET 2005
Rating: none
Paul Kimmel - 09/19/2005
Partial classes separate out all of the plumbing that the .NET form designer adds to forms and give VB.NET programmers the clean code-behind experience they're used to. Learn how to use them.

Using an Indexer in C#
Rating:
Bradley Jones - 11/26/2002
Indexers allow objects to be treated like arrays. Learn how to use an indexer with a C# object.


Inheritance



C# Inheritance with the New Modifier
Rating:
Ziad Salloum - 10/01/2002
Overview of the new modifier and how it's used to override methods in derived classes


Interfaces



'Using' the IDisposable Interface
Rating:
darwen - 11/24/2004
The IDisposable interface can be used for far more than just the releasing of memory and resources. Learn how to use the interface to ensure that post conditions of code blocks are always met.

Interfaces in C#
Rating:
Fatima Ahmed - 07/14/2004
Learn about interfaces and how they inherit in C#.

Using Multiple Interfaces
Rating:
Bradley Jones - 04/28/2003
Multiple inheritance is not possible in C# using classes; however, you can implement multiple interfaces. This is a simple example of inheriting characteristics of multiple interfaces.


Operators



.NET Tip: Create a Class with Overloaded Constructors
Rating: none
Eric Smith - 06/26/2006
Overloading the constructor of a class, which is the method called when you instantiate an object, ensures that your object is populated with all the information it needs to operate properly.

[Updated] Using Nullable Types in C#
Rating:
Bradley Jones - 08/17/2005
The next release of C# (ECMA-334, 3rd Edition) includes the ability to use nullable data types. If you are unfamiliar with nullable types, this introduction is for you!

Overloading Operators in VB.NET 2.0
Rating: none
Paul Kimmel - 06/14/2005
VB.NET 2.0 enables you to utilize overloaded operators, which not only are easy to implement but also can provide your classes with intuitive operators. Learn how to use this powerful feature.

Overloading Operators in C#
Rating: none
Mark Strawmyer - 10/13/2003
One of these concepts included with C#, but not with Visual Basic .NET, is the ability to overload operators.


Reflection



Using Reflection to Dump Objects
Rating: none
Piero Viano - 05/01/2003
Learn how to write some .Net code to use a feature called "reflection" to generate a String containing values from all object fields.

Late Binding and On-the-Fly Code Generation Using Reflection in C#
Rating: none
K Balaji - 11/26/2002
How to achieve late binding and how to create and execute code on the fly (during runtime) using Refection. Also, discover how to emit MSIL code to stream to the Just-In-Time compiler.


Remoting



Improved .NET Remoting, Part 2: Secure TCP
Rating:
Mark Strawmyer - 07/25/2005
The security enhancements that the .NET Framework 2.0 made to the TCP channel enable secure TCP communication either through code or application configuration files. Learn how to apply both techniques to .NET remoting clients and servers.

.NET Remoting and Event Handling in VB .NET, Part 3
Rating:
Paul Kimmel - 03/07/2005
Learn the ins and outs of .NET remoting and event handling in VB .NET with an examination of the supporting code in a simple chat client and server application, including the use of the command, observer, singleton, and factory patterns.

.NET Remoting and Event Handling in VB .NET, Part 2
Rating: none
Paul Kimmel - 03/03/2005
Learn how to implement a client's configuration file in VB .NET so that the client can talk to your server, and find out why clients that handle server events have to be remotable.

.NET Remoting Using a New IPC Channel
Rating: none
SeenivasaRagavan Ramadurai - 02/22/2005
Learn a new way to handle .NET remoting.

Wrapping MFC Objects For Use With .NET Remoting
Rating:
Tom Archer - MSFT - 06/25/2004
One drawback to using remoting in a mixed—MFC/.NET—environment is that MFC objects cannot be remoted. Explore this technique for overcoming this limitation.

.NET Remoting in Visual C++
Rating:
Kate Gregory - 03/31/2004
Remoting is one of the three techniques available on the CLR for creating distributed applications.

.NET Remoting
Rating:
Mark Strawmyer - 10/10/2002
Remoting is a more efficient means than Web Services for allowing programs to interact. Learn how remoting differs from Web Services and other technologies. More importantly, learn how to implement remoting.


Serialization



Remoting Chat Application
Rating:
Jayant Kulkarni - 08/11/2005
The application is designed using .NET remoting framework 1.0. .NET remoting provides a very powerful framework for the distributed application.

Serialization Part 2: Version-Tolerant Serialization
Rating: none
Mark Strawmyer - 06/29/2005
Serialization introduced many powerful capabilities, but it also introduced problems as you refactor your objects to include new properties. Learn how the version-tolerant serialization included in the upcoming 2.0 Microsoft .NET Framework will help.

Object Serialization Using .NET
Rating:
Ali Sufyan - 05/31/2004
Explore how to utilize serialization in .NET.

Uniquely Identifying Serialized Files with Managed C++
Rating:
Tom Archer - MSFT - 05/20/2004
In this week's .NET Tips & Techniques column, Tom Archer presents a step-by-step approach to uniquely identifying your serialized files using Managed Extensions, custom serialization, and GUIDs.

C++ Tip: Serializing .NET Objects with Managed C++
Rating:
Tom Archer - MSFT - 05/07/2004
In this installment of the .NET Tips & Techniques column, learn how to serialize entire objects—as well as selected members—to and from disk using Managed C++ Extensions.

Serialization/Deserialization in .NET
Rating: none
Mark Strawmyer - 11/18/2003
Discover how to easily store and retrieve objects into a file, a database, or in an ASP session state.


Threading



Safe Multithreading with the BackgroundWorker Component
Rating:
Paul Kimmel - 10/12/2005
Until the .NET Framework controls are thread safe, you will have to use Control.Invoke and delegates to marshal data from background worker threads to the Windows Form thread.

Batched Execution Using the .NET Thread Pool
Rating: none
Nick Wienholt - 01/07/2005
The .NET thread pool's functionality for executing multiple tasks sequentially in a wave or group is insufficient. Luckily, a Visual C++.NET helper method that uses other types within the System.Threading namespace provides this batch-execution model.

Attributes
Rating: none
xulu - 05/24/2004
C# provides a mechanism for defining declarative tags, called attributes, which you can place on certain entities in your source code to specify additional information. The information that attributes contain can be retrieved at run time through reflection. You can use or you can define your own custom attributes.

Changing the Default Limit of 25 Threads of the ThreadPool Class
Rating: none
Yash Malge - 06/19/2003
It should be a simple function call to change the default thread limit of 25 threads of the ThreadPool class per processor. But, it's not that easy at all. Learn the way to do this.


Unmanaged Code



Using Unmanage Code in C#
Rating:
Zeeshan Amjad - 10/10/2001
Another view on how to work with unmanged code an unmanged dlls from C#.


Unsafe



How Unsafe is C#'s Unsafe Block?
Rating: none
Faisal Yousuf - 08/06/2003
A quick look at the C# unsafe keyword and the dangers of its use.


Flash Demo: See how Crystal Reports Server can help you manage and deliver timely corporate reports.
ISV Innovation Tech Briefings: Ready to Learn About the Latest Developer Technologies?
RAVEN Extends Visual Studio for Requirements Development
Download: IBM Rational Functional Tester. Get automated functional & regression testing for apps.
On-demand Webcast: Developing Robust Field Service Wireless Solutions on BlackBerry Devices.


JupiterWeb networks:

internet.comearthweb.comDevx.comGraphics.com

Search JupiterWeb:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterWeb

Jupitermedia Corporate Info