OSDN Git Service

Initial contents of nt2chview
[nt2chview/stable.git] / NT2chCtrl45 / NTResViewPanel_file.cs
1 using System;\r
2 using System.Collections.Generic;\r
3 using System.IO;\r
4 using System.Linq;\r
5 using System.Text;\r
6 using System.Threading.Tasks;\r
7 \r
8 namespace NT2chCtrl\r
9 {\r
10     public partial class NTResViewPanel\r
11     {\r
12 \r
13         string loadHtml(string path)\r
14         {\r
15             string line = null;\r
16 \r
17             FileStream fs = null;\r
18             try\r
19             {\r
20                 fs = File.Open(path, FileMode.Open, FileAccess.Read);\r
21                 StreamReader sr = new StreamReader(fs);\r
22 \r
23                 line = sr.ReadToEnd();\r
24 \r
25                 fs.Close();\r
26                 fs = null;\r
27             }\r
28             catch (Exception e)\r
29             {\r
30                 System.Diagnostics.Debug.WriteLine(e.StackTrace);\r
31             }\r
32             finally\r
33             {\r
34                 if (null != fs)\r
35                     fs.Close();\r
36             }\r
37 \r
38             return line;\r
39         }\r
40 \r
41     }\r
42 }\r