From 12b8e718e1fad0ce20aba3c61d1ce0c7b3f47fc3 Mon Sep 17 00:00:00 2001 From: Ben Maurer Date: Mon, 29 Nov 2004 03:28:27 +0000 Subject: [PATCH] Make the sample have good coding :-) svn path=/trunk/gtk-sharp/; revision=36750 --- sample/gtk-html-sample.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sample/gtk-html-sample.cs b/sample/gtk-html-sample.cs index 723e11349..b594503c7 100644 --- a/sample/gtk-html-sample.cs +++ b/sample/gtk-html-sample.cs @@ -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 (""); s.Write ("Hello world!");