C Sharp REPL example

Previously we showed you a C# example for your Raspberry Pi. We installed a text editor and then the mono development environment. We then created our c sharp example in our text editor , compiled and ran it. This typically is the way you write programs and develop but mono gives you another option called C# REPL, this is a interactive shell that is part of the mono development environment. More details available from http://www.mono-project.com/docs/tools+libraries/tools/repl/

Open up the terminal and type in csharp at the command prompt, you should see something like the following

csharp console

In the following examples we will try some easy one liners using the Environment Class. More details can be found at https://msdn.microsoft.com/en-us/library/system.environment.osversion%28v=vs.110%29.aspx

 

[codesyntax lang=”csharp”]

Environment.OSVersion

Environment.ProcessorCount

Environment.MachineName

[/codesyntax]

 

You can see these and some other examples below

csharp REPL

Related posts

Getting started with Tkinter on the Raspberry Pi

Raspberry PI LDR example

Raspberry Pi and Max7219 7 segment display

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Read More