|
Home >> .NET / C# >> C# >> Basic Syntax
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
Language Feature Highlight: Local Type Inference in C# 3.0 and Visual Basic 9.0
Rating: none Mark Strawmyer - 11/14/2007 Learn about local type inference in C# 3.0 and Visual Basic 9.0. Examine why it is relevant and the syntax for its use.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
[Updated] Creating a C# Gradient Progressbar Component
Rating:      Hannes du Preez - 05/08/2008 Learn how to create your own Progressbar-like control, which exposes the same
properties as a normal Progressbar, but with added visual appeal.Creating a DockablePanel-Controlmanager Using C#, Part 6
Rating:      JonnyPoet - 03/03/2008 Learn how to create more advanced docking features, such as docking to the upper right corner or having some panels docked at the bottom of an MDI Form collected together in a TabControl. Each of the different parts include the full source code (up to that point), as well as a retrospective short explanation about the different topics covered already. [Updated] Creating a DockablePanel-Controlmanager Using C#, Part 5
Rating:      JonnyPoet - 02/20/2008 Learn how to size a docked Panel and how to undock it again as well as which actions are needed to prepare the more advanced docking actions. [Updated] Creating a Dockable Panel-Controlmanager Using C#, Part 2
Rating:      JonnyPoet - 12/07/2007 Learn how to get a borderless Form to move around on the screen by capturing it with the mouse and dragging it, and to be able to resize the form, the same way as a normal sizeable Form can be sized by dragging its edges. Creating a Dockable Panel-Controlmanager Using C#, Part 1
Rating:      JonnyPoet - 08/31/2007 Learn how to create your own usercontrols. This is done in several articles of increasing complexity so the reader will be able to follow it easily. WCF Chat Application
Rating:      Jayant Kulkarni - 03/22/2007 The application uses .NET 3.0 and WCF to establish a peer to peer communication using netPeerTcpBinding. It uses .NET 3.0 predefined contract and .NET predefined services. 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
Creating a DockablePanel-Controlmanager Using C#, Part 7
Rating:      JonnyPoet - 05/15/2008 Going on to design a dockable panel, discover some very interesting techniques, such as hooking the mouse and how to debug an application in such cases. Learn to unpin a docked panel so it slides to the border of the main application.Why Is Everything So Darn Declarative?
Rating: none Angel Amador - 01/30/2008 Learn about a different approach of using the GridView and DetailsView controls in a web app. Creating a DockablePanel-Controlmanager Using C#, Part 4
Rating:      JonnyPoet - 01/10/2008 This is the 4th part of a series of articles about how to design DockingForms using a DockingManager written in C#. Creating a Dockable Panel ControlManager Using C#, Part 3
Rating:      JonnyPoet - 12/04/2007 Continue your study of how to create your own dockable Forms. Lights Out Game (in C#)
Rating:      Bradley Jones - 02/27/2007 Just play a game of Lights Out, or take some time to see an array of buttons put to use. 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
.NET Tip: Converting Strings to Enum Values
Rating: none Jay Miller - 01/25/2008 Learn how to take a string and convert it into an enumeration value.[Updated] Flags Enumerations
Rating:      David Oldfield - 12/22/2006 The documentation on Microsoft's flags enumerations is rather sketchy at best, but offers a more ideal solution for a great many problems. The problem is, with such little documentation it can be very time consuming to figure out how to use them correctly. Here is a small walkthrough explaining a relatively simple means of interacting with them through use of the bitwise OR operator. 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
.NET Tip: Throwing Custom Exceptions
Rating:      Jay Miller - 10/12/2007 Use custom exceptions to add information that will be more meaningful to your users when exceptions occur. And, you still can maintain all the information from the original exception..NET Tip: Throwing Exceptions: Will You be Able to Catch What You Expect?
Rating: none Jay Miller - 09/21/2007 Handling exceptions can sometimes be a little tricky. If you are not careful, your code may act on the wrong information. Learn how to bubble up exceptions while keeping the original exception information intact. .NET Tip: Implement IDisposable to Ensure Your Objects Clean Up After Themselves
Rating:      Jay Miller - 08/21/2007 Be a good resource citizen by implementing IDisposable. You will be able to ensure that your objects have the opportunity to release all of their managed and unmanaged resources. .NET Tip: Managing Resources with the Using Statement
Rating: none Jay Miller - 08/13/2007 Take control of the lifetime of your objects. Release your object's resources on your schedule, not when the CLR determines they are no longer needed. [Updated] Managing Exceptions in .NET
Rating:      Jayant Kulkarni - 12/21/2006 Learn about the techniques and guidelines you can use to make your application stable and less prone to errors, hande errors in a graceful manner, and avoid crashing. 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
.NET Tip: Restrict the Access to Your Properties!
Rating: none Jay Miller - 08/03/2007 Stop unwanted changes to your properties! Discover how to you can stop worrying about accidentally changing values, while still allowing multiple views into your classes!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
There is More Than Just a Little Touching...
Rating: none Bradley Jones - 11/24/2008 The way you interact with a personal computing device is changing and is about to change even more with lots of touching and even a little hidden video.Getting Up and Running with the Composite UI Application Block for WPF
Rating: none Jani Järvinen - 09/29/2008 Building small applications from scratch is easy enough with almost any available programming technology. However, if you are assigned the task to build large applications and have the requirement to re-use code either now or tomorrow, you need to be a lot more careful. Microsoft has ready-made patterns that help you build complex Windows Presentation Foundation applications with reusability and componentized design in mind. .NET Tip: Take Advantage of Interfaces
Rating: none Jay Miller - 07/19/2007 Stop writing more code than needed. You can streamline your code if you use interfaces. You will be able to write simpler, more flexible, and more maintainable applications when you apply 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
Parsing Is Easy: Base C Sharp Classes and Expressions Calculator
Rating:      AlexNek - 03/21/2008 Learn about parsing, and creating classes and expressions.Extending Outlook Functionality with a .NET Add-In
Rating: none Rachel Baker - 10/18/2007 Interacting with Office functionality in a .NET application can add a new level of functionality while providing the user with familiar methods of getting work done. Explore extending Outlook via a sample add-in. Microsoft Outlook Integration with C#.NET
Rating:      Rachel Baker - 09/24/2007 Interacting with Office functionality in a .NET application can add a new level of functionality while providing the user with familiar methods of getting work done. In Part One of this series, explore a sample WinForms Outlook contact management application. Implementing a Decimal-to-Fraction Class with Operator Overloading
Rating: none Paul Kimmel - 08/15/2007 Learn how to implement a Fraction's class—which is ideally suited for overloaded operators and how to overload operators in Visual Basic. .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
Dumping an Object's State with a DynamicMethod
Rating: none Paul Kimmel - 11/07/2008 Emitted code and the DynamicMethod have the benefit of speed and the emitted code can be unloaded when the DynamicMethod goes out of scope, resulting in the best of all worlds..NET Tip: Using Extension Methods
Rating: none Jay Miller - 12/31/2007 Extension methods allow you to create utility functions and have them appear to be part or your classes or the built-in classes. You'll learn by making a method from an earlier tip available as an extension method. .NET Tip: Display All Fields and Properties of an Object
Rating: none Jay Miller - 11/30/2007 Learn how to display all of the fields and properties of any object. By using a little reflection, you can expose the internals of your objects. Using Reflection to Dump Objects
Rating:      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
Windows Meeting Space
Rating: none M. Rajesh - 07/23/2007 Windows Vista ushered in a new era of collaborative working with Windows Meeting Space. Here, you'll learn how to initiate a secure workgroup of up to nine users over a variety of connections.Looking at the WCF Windows Communication Foundation
Rating:      Jayant Kulkarni - 02/20/2007 Discover Windows Communication Foundation (WCF). Microsoft introduced this technology, which is a part of .NET 3.0, to make your life easy when it comes to building distributed applications. 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:      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
The Practical Guide to Multithreading - Part 1
Rating:      Ajay Vijayvargiya - 10/02/2009 Understand from this guide how and when - as well as when not - to use multithreading.Using the Task Parallel Library and PLINQ to Go Parallel
Rating: none Jani Järvinen - 06/30/2009 With more and more computers using a multi-core processor, the free lunch of increased clock speeds and the inherent performance gains are over. Software developers must instead make sure their applications take use of all the cores available in an efficient manner. New features in .NET 4.0 mean that managed code developers too can join the party. 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 - 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.

|
|