The file handlers

All that remains now is to define the code that loads a file to textBox1 and allows the user to save the contents of textBox2 to a file. There is nothing strange new or odd about this code - but it is relatively recent that Silverlight allowed users to save and load files. You might think that it would be a security risk but as the user picks the file to load and the location to save to it probably isn't too bad.

The load file button is easy enough. First we setup the parameters for the OpenFileDialog:

You can set the Filter to a range of options .cs, .vb and so on but in this case All Files seems like a reasonable default. The user can also only select one file at a time - you could change this so that multiple files were loaded but it doesn't seem to be a useful option.

Again notice the use of Write to simply write everything in the TextBox out to the file without having to write a loop.

Trying it out

You can see the convertor in action in the following screen dump - converting its own code into VB .NET

Of course as this is a Silverlight application you can try it out for yourself at our Resources and Tool section . You need to keep in mind the initial comments about only trying to convert complete classes and only converting correct code.

SNTP is a network protocol for obtaining an accurate time and it is an interesting exercise to build an SNTP client. In this article the language used is C# but it is easy enough to generalise to a la [ ... ]

Using web browser macros, the need to get more control over what is happening during the automated use of a web page becomes increasingly obvious. After trying a number of possible solutions, C# and . [ ... ]