OSDN Git Service

02338c11f4ba2bc0510705ad07795920c7acda87
[handbrake-jp/handbrake-jp-git.git] / win / C# / frmDvdInfo.cs
1 using System;\r
2 using System.Collections.Generic;\r
3 using System.ComponentModel;\r
4 using System.Data;\r
5 using System.Drawing;\r
6 using System.Text;\r
7 using System.Windows.Forms;\r
8 using System.IO;\r
9 \r
10 \r
11 namespace Handbrake\r
12 {\r
13     public partial class frmDvdInfo : Form\r
14     {\r
15         /// <summary>\r
16         /// This window should be used to display the RAW output of the handbrake CLI which is produced during the scan.\r
17         /// </summary>\r
18         public frmDvdInfo()\r
19         {\r
20             InitializeComponent();\r
21             this.rtf_dvdInfo.Text = string.Empty;     \r
22         }\r
23 \r
24         private void btn_close_Click(object sender, EventArgs e)\r
25         {\r
26              this.Hide();\r
27         }\r
28 \r
29         private void frmDvdInfo_Load(object sender, EventArgs e)\r
30         {\r
31             this.rtf_dvdInfo.Text = string.Empty;\r
32             readFile();\r
33         }\r
34 \r
35         private void readFile()\r
36         {\r
37             try\r
38             {\r
39                 string appPath = Application.StartupPath.ToString();\r
40                 appPath = appPath + "\\";\r
41                 StreamReader sr = new StreamReader(appPath + "dvdinfo.dat");\r
42 \r
43                 string line = sr.ReadLine();\r
44 \r
45                 while (line != null)\r
46                 {\r
47                     this.rtf_dvdInfo.AppendText(line + System.Environment.NewLine);\r
48                     line = sr.ReadLine();\r
49                 }\r
50                 sr.Close();\r
51             }\r
52             catch (Exception)\r
53             {\r
54                 // Don't do anything\r
55             }\r
56         }\r
57     }\r
58 }