using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using WeifenLuo.WinFormsUI.Docking; using System.IO; using RomCheater.Logging; namespace RomCheater.Docking { public partial class FloatingAboutBox : Form { public FloatingAboutBox() { InitializeComponent(); } private void FloatingAboutBox_Shown(object sender, EventArgs e) { string path = Application.StartupPath; string version_file = "current-version.txt"; string full_path = string.Format(@"{0}\{1}", path, version_file); FileInfo fi = new FileInfo(full_path); if (!fi.Exists) { logger.Error.WriteLine("Could not find {0} in path {1}", version_file, path); return; } StringBuilder builder = new StringBuilder(); using (FileStream fs = new FileStream(full_path, FileMode.Open, FileAccess.Read, FileShare.ReadWrite)) { StreamReader sr = new StreamReader(fs); while (!sr.EndOfStream) { builder.AppendLine(sr.ReadLine()); } sr.Close(); } txtVersion.Text = builder.ToString(); } } }