Tutorials
Step-by-step lessons for people who are new to .NET. Each one explains the ideas first, then builds a small program you can run, with the real output and screenshots.
How to use the tutorials#
Every tutorial has a program in the folder samples/UsingDotNet/tutorials. Read the explanation, run the program, change it, and do the exercises at the end. The programs are real: they are tested together with the rest of the package, so the output you see here is the output you will get.
cd samples/UsingDotNet/tutorials
ring ch01_first_look.ring # a console tutorial
ring ch10_counter.ring # a window
ring ch10_counter.ring --selftest # the same program checks itself and closesYou do not need to know .NET to start. If you know Ring, you can follow every tutorial. The first two pages explain the .NET words that you will meet.
The lessons about NuGet packages (the chapter Libraries and packages) run dotnet publish, so they need the .NET SDK and, the first time, the internet to get the packages.
Start here#
The chapters#
The tutorials are grouped by topic. Read The basics first, in order; after that, choose the chapter that you need. The pages inside a chapter lead from one to the next, and the last page of a chapter points to the next chapter.
| Chapter | What it is about |
|---|---|
| The basics | Console programs that use the class library: text, numbers, collections, files, JSON and XML, errors, hashing, HTTP, tasks and processes. |
| Text and data formats | Regular expressions, formatting, Unicode and text file encodings, comparing and escaping text, URLs, Base64 and hexadecimal, domain names, MIME types, JSON in two styles, XML and XSLT, Markdown, spelling, and two projects: a mail merge and a syntax highlighter. |
| Numbers, dates and money | The number types and their limits, rounding, big numbers, number systems, exact money, vectors, randomness and statistics, then dates, time zones, calendars, working days and cultures. |
| Collections and algorithms | Arrays, sets and other data structures, collections for many threads, enums and identifiers, undo and queues, recursion and an expression calculator. |
| Files and streams | Paths, file information and disks, streams, binary files and random access, compression (GZip, ZIP, tar), file patterns, watching a folder, and projects that work on many files: a log analyzer, a duplicate finder, a backup tool, a file renamer, a file comparison and a checksum list. |
| Processes and performance | Asking the computer about itself, command-line tools, logging and tracing, starting and talking to other programs, tasks that wait, releasing resources, measuring speed and memory, and the Windows Registry. |
| Networking and the web | IP addresses and networks, TCP and UDP sockets, WebSockets, HttpClient and REST, web services and small web sites, route templates, a link shortener, and e-mail messages. |
| Security | Hashing, encryption and signing, certificates, protecting data, logins and sessions, identities and claims, and rate limiting. |
| Databases and services | SQL and Entity Framework, reports, Microsoft Access, and the services of an application: settings and configuration, caching and dependency injection. |
| Windows Forms | Windows with controls, the keyboard and the mouse, layout, lists and grids, formatted text, the clipboard, drag and drop, dialogs, more than one window and a tray icon, printing, menus, timers, drawing, images and charts (Windows only). |
| WPF | XAML windows, layout and styles, data binding, menus and tabs, lists and dynamic content, and animation (Windows only). |
| Projects with windows | Complete programs: a to-do list, Tic-Tac-Toe, a quiz, a command runner, an address book with a database, a sorting lab, a maze, an image filter lab and a chat (Windows only). |
| Libraries and packages | Giving Ring code to .NET (callbacks and events), reflection and expression trees, an object inspector, a library written in C#, the generic functions, and then NuGet packages and native code: a NuGet package, a QR code, Excel files, pictures, PDF files, text to speech, sound, native DLLs, and a project that uses three packages together. |
| Testing and release | The common mistakes, programs that run on more than one system, testing your programs, and giving a program to other people. |
Where to start#
| If you want to... | Read |
|---|---|
| understand the vocabulary | .NET for Ring programmers, Reading the .NET documentation |
| learn the class library step by step | the chapter The basics |
| work with text, JSON and XML | Text and data formats |
| calculate with numbers, dates and money | Numbers, dates and money |
| read, write and pack files | Files and streams |
| talk to other computers, build a web service | Networking and the web |
| store data | Databases and services |
| protect data and users | Security |
| build programs with windows | Windows Forms, then WPF and Projects with windows |
| go deeper: callbacks, reflection, your own C# library, NuGet packages | Libraries and packages |
| find and fix mistakes, test and give away a program | Testing and release |
| give your program to other people | the tutorial Giving your program to others |
The basics#
Console programs that use the class library: text, numbers, collections, files, JSON and XML, errors, hashing, HTTP, tasks and processes. Start here and read them in order.
Text and data formats#
Regular expressions, formatting, Unicode and text file encodings, comparing and escaping text, URLs, Base64 and hexadecimal, domain names, MIME types, JSON in two styles, XML and XSLT, Markdown, spelling, and two projects: a mail merge and a syntax highlighter.
Numbers, dates and money#
The number types and their limits, rounding, big numbers, number systems, exact money, vectors, randomness and statistics, then dates, time zones, calendars, working days and cultures.
Collections and algorithms#
Arrays, sets and other data structures, collections for many threads, enums and identifiers, undo and queues, recursion and an expression calculator.
Files and streams#
Paths, file information and disks, streams, binary files and random access, compression (GZip, ZIP, tar), file patterns, watching a folder, and projects that work on many files: a log analyzer, a duplicate finder, a backup tool, a file renamer, a file comparison and a checksum list.
Processes and performance#
Asking the computer about itself, command-line tools, logging and tracing, starting and talking to other programs, tasks that wait, releasing resources, measuring speed and memory, and the Windows Registry.
Networking and the web#
IP addresses and networks, TCP and UDP sockets, WebSockets, HttpClient and REST, web services and small web sites, route templates, a link shortener, and e-mail messages.
Security#
Hashing, encryption and signing, certificates, protecting data, logins and sessions, identities and claims, and rate limiting.
Databases and services#
SQL and Entity Framework, reports, Microsoft Access, and the services of an application: settings and configuration, caching and dependency injection.
Windows Forms#
Windows with controls, the keyboard and the mouse, layout, lists and grids, formatted text, the clipboard, drag and drop, dialogs, more than one window and a tray icon, printing, menus, timers, drawing, images and charts (Windows only).
WPF#
XAML windows, layout and styles, data binding, menus and tabs, lists and dynamic content, and animation (Windows only).
Projects with windows#
Complete programs: a to-do list, Tic-Tac-Toe, a quiz, a command runner, an address book with a database, a sorting lab, a maze, an image filter lab and a chat (Windows only).
Libraries and packages#
Giving Ring code to .NET (callbacks and events), exploring code with reflection and building it with expression trees, an object inspector, a library written in C#, and the generic functions; then NuGet packages and native code: how a package comes to Ring, a QR code, Excel files, pictures, PDF files, text to speech, sound, native DLLs, and a project that uses three packages together.
Testing and release#
The mistakes that everybody makes first and their messages, programs that run on more than one system, testing your programs, and giving a program to other people.
After the tutorials: the Core concepts page lists the naming rules, the Class reference lists every class, and the applications are bigger programs to read.