public BackupViewer(Main main) { InitializeComponent(); _Main = main; this.Icon = Me.Amon.Hosts.Properties.Resources.Icon; if (Directory.Exists(Main.BAK_DIR)) { string name; StringBuilder text = new StringBuilder(); foreach (string file in Directory.GetFiles(Main.BAK_DIR, string.Format(Main.HOSTS_FILE, "*"))) { name = Path.GetFileName(file); name = name.Substring(6); if (name.Length != 14) { continue; } text.Append(name); text.Insert(12, ':').Insert(10, ':'); text.Insert(8, ' '); text.Insert(6, '-').Insert(4, '-'); LbBak.Items.Add(new KVItem { K = name, V = text.ToString() }); text.Clear(); } } }
public SolutionViewer(Main main) { InitializeComponent(); _Main = main; this.Icon = Me.Amon.Hosts.Properties.Resources.Icon; if (Directory.Exists(Main.DAT_DIR)) { string name; foreach (string file in Directory.GetFiles(Main.DAT_DIR, string.Format(Main.HOSTS_FILE, "*"))) { name = Path.GetFileName(file); LbSln.Items.Add(name.Substring(6)); } } }