C# Tutorial

This tutorial covers Microsoft's new programming language C#. It is aimed at people with some programming experience, although it tries not to assume too much knowledge. The contents page contains links to all the lessons, and to subsections of these lessons. Otherwise, choose from the links in the box on the right.

Note that the tutorial covers the syntax of C#, rather than going through the .NET framework classes. Since there are over 6000 of these classes, this would have been rather a big job. Indeed, the coverage of the syntax as it is isn't anywhere near exhaustive (for detailed specifications, see the C# reference material).

Softsteel Solutions has now split up as a company, but we are maintaining this site for the time being since people seem to find the tutorials useful. If you have any questions about, or comments on these lessons, your best bet is ewan@softsteel.co.uk.

* 15/04/07 I'm soon going to overhaul the existing C# tutorials and write some new lessons for C# 3. Before that, though, I've written a tutorial for ASP.NET Ajax which I'm hoping will prove useful.

* 11/12/05 - Many thanks to Brian Condley for pointing out a potential problem with defining the preprocessor variable DEBUG. I also noticed that the XSL used to generate code line numbers wasn't working properly any more, so I updated that.

* 13/11/05 - I've now put up a wiki to allow users (including myself) an easy way to expand on the tutorials. I'm really hoping that this will encourage all of us to improve this resource (though at the time of writing it's almost empty).

* 02/02/05- We've been saying enumerator where we meant enumeration. Sorry for any confusion this has caused, and thanks to Josh Kapp for pointing it out.

* 24/10/04 - I've converted a 'backgrounder' paper on caching in ASP.NET that I wrote for work. If you're interested in C# because you want to write ASP.NET, then this tutorial might be of interest to you.

* 20/10/04 - I've put up five more tutorials, relating to the forthcoming C# 2.0.

* 27/09/04 - I've finally sold my soul and put some Google ads on the site. Forgive me.

* 26/09/04 - I've put in some code to access Amazon web services in order to display C# book data. This makes use of some slightly complicated asynchronous ASP to update the list daily, so I expect that it'll all fall over at some point soon. But I think that it's a lot better than trying to update the book list manually, which I wasn't doing anyway.

* 01/05/03 - aaaah. More enumerator nonsense. Hopefully now corrected, plus that lesson has been expanded. Many thanks to Quarup Barreirinhas for his input on this.

* 25/04/03 - thanks to more feedback the enum example now shows the right output and we've hopefully stopped the occasional use of 'chapter' for 'lesson'.

* 17/04/03 - we're grateful to a correspondent for putting us right about the 'param' keyword discussed in lesson 13. Method signatures don't include the params keyword, but they do include the parameters marked by this keyword.

* 05/02/03 - someone discovered our mistake in the code in lesson 10, so we put it right. In which lesson will the next error be found? Why not get together with friends and play bug sweepstake.

* 07/03/02 - we've rewritten the lesson on xml documentation (lesson 19). As well as being more thorough, it raises an issue about conflicting advice on how to use some of the tags, and highlights the many problems with the documenter. We also unveil the Softsteel C# Documenter, a free software project released under the GNU GPL.

* 12/02/02 - with the final release of the .NET framework we have been through and checked all the code, fixing various errata. Also added the 'patchwork book', a collection of links to sample chapters available on the web.

* 06/02/02 - corrected one erratum, added lots of books to the list of C# books.

* 04/01/02 - corrected some errata about pointers on lesson 5 (pointed out by another helpful correspondent), and added some explanatory text

* 02/12/01 - corrected some errata on lesson 13 (pointed out by a helpful correspondent)

* 07/10/01 - following feedback, we have added a section on indexers. In response to other queries, we should also like to say that we are open to the idea of covering the .NET classes by accepting other people's tutorials. We would review and verify these, and retain the right to rewrite or expand them to fit our style, but the original author would be fully credited. (If this is too much of an imposition, there are plenty of other C# sites out there which host tutorials).

* 09/09/01 - a few updates have been made to account for beta 2 release changes.

* We have now set up links to recommended C# books available at Amazon.

* Following feedback, we have now introduced printer-friendly versions of these lessons. Note, however, that we have no plans to publish a single document containing the whole tutorial.

Link Building Information