Make the sample have good coding :-)

svn path=/trunk/gtk-sharp/; revision=36750
This commit is contained in:
Ben Maurer 2004-11-29 03:28:27 +00:00
parent 6eea226ab7
commit 12b8e718e1

View File

@ -14,9 +14,9 @@ class HTMLSample {
win.Add (html);
HTMLStream s = html.Begin ("text/html");
if (args.Length > 0){
StreamReader r = new StreamReader (File.OpenRead (args [0]));
s.Write (r.ReadToEnd ());
if (args.Length > 0) {
using (StreamReader r = File.OpenText (args [0]))
s.Write (r.ReadToEnd ());
} else {
s.Write ("<html><body>");
s.Write ("Hello world!");