/[RomCheater]/trunk/RomCheater/Docking/FloatingAboutBox.cs
ViewVC logotype

Annotation of /trunk/RomCheater/Docking/FloatingAboutBox.cs

Parent Directory Parent Directory | Revision Log Revision Log


Revision 147 - (hide annotations) (download)
Sun May 27 23:05:18 2012 UTC (8 years, 5 months ago) by william
File size: 1415 byte(s)

1 william 147 using System;
2     using System.Collections.Generic;
3     using System.ComponentModel;
4     using System.Data;
5     using System.Drawing;
6     using System.Linq;
7     using System.Text;
8     using System.Windows.Forms;
9     using WeifenLuo.WinFormsUI.Docking;
10     using System.IO;
11     using RomCheater.Logging;
12    
13     namespace RomCheater.Docking
14     {
15     public partial class FloatingAboutBox : DockContent
16     {
17     public FloatingAboutBox()
18     {
19     InitializeComponent();
20     }
21     private void FloatingAboutBox_Shown(object sender, EventArgs e)
22     {
23     string path = Application.StartupPath;
24     string version_file = "current-version.txt";
25     string full_path = string.Format(@"{0}\{1}", path, version_file);
26     FileInfo fi = new FileInfo(full_path);
27     if (!fi.Exists)
28     {
29     logger.Error.WriteLine("Could not find {0} in path {1}", version_file, path);
30     return;
31     }
32     StringBuilder builder = new StringBuilder();
33     using (FileStream fs = new FileStream(full_path, FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
34     {
35     StreamReader sr = new StreamReader(fs);
36     while (!sr.EndOfStream) { builder.AppendLine(sr.ReadLine()); }
37     sr.Close();
38     }
39     txtVersion.Text = builder.ToString();
40     }
41     }
42     }

  ViewVC Help
Powered by ViewVC 1.1.22