How do I use a mono class from JavaScript?

Suppose I want to do something like this:

var sw : StreamWriter = new StreamWrite(“foo.txt”);

StreamWriter being System.IO.StreamWriter from .NET

At the top of the script put:

import System.IO.StreamWriter;

Thank you!

If I import System.IO do I get StreamWriter et al?

Importing just allows shorthand…you could write System.IO.StreamWriter at any time, but by using the import keyword you tell the compiler to check those places for classes that aren’t found.

So you can do import System.IO and then use StreamWriter shorthand (it’ll automatically look for StreamWriter in System.IO).