Wednesday, February 1, 2012

.NET and Javascript

if you haven't used the Javascript.NET, i must inform you that it's a handy windows tool that you can use and create tiny utilities.

the only requirement is that you have installed a .NET Framework (i used .NET 2.0). from the .NET Package you will find the "jsc" compiler.

try this out;

(1) create a file named "temp.js"

(2) fill the file "temp.js" with the following code;

---- begin code ----

import System;

var message = {"myGalaxy" : "Hello Milky Way",
               "myWife" : "I love you"};

Console.WriteLine(message["myGalaxy"]);
Console.WriteLine(message["myWife"]);

---- end code ----

(3) compile using jsc,

jsc temp.js

(4) a file temp.exe will be created, run that file