The following tutorial shows how to create and execute a simple script.
By using any text editor (eg. Notepad.exe) create file hello.cs
that contains the following code:
using System; using System.Windows.Forms; class Script { static public void Main(string[] args) { Console.WriteLine("Hello World!" ); MessageBox.Show("Hello World!"); } } |
Click here to obtain full listing of hello.cs
In this example the script makes the use of FCL class MessageBox that resides in
assembly System.Windows.Forms.dll. The script engine dynamically identifies
what assemblies are required and loads them at run-time.
The easiest way to create the skeleton code for your script is to execute following command in command prompt:
This will instruct script engine to output sample code in a file in current directory (in this case hello.cs).