using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using System.IO; using System.Data; namespace Account_Editor { class Utility { public static void Information(string Message) { MessageBox.Show(Message, "Character Editor", MessageBoxButtons.OK, MessageBoxIcon.Information); } public static bool Question(string Message) { DialogResult Result = new DialogResult(); Result = MessageBox.Show(Message, "Character Editor", MessageBoxButtons.YesNo, MessageBoxIcon.Information); if (Result == DialogResult.Yes) { return true; } else { return false; } } public static string GetSHNString(DataTable SHN, int Cell1, int Cell2, string Equal) { string Return = ""; for (int Counter = 0; Counter < SHN.Rows.Count; Counter++) { if (SHN.Rows[Counter].ItemArray[Cell1].ToString() == Equal) { Return = SHN.Rows[Counter].ItemArray[Cell2].ToString(); } } return Return; } public static string GetConfigValue(string Value) { using (StreamReader Reader = new StreamReader("Config.txt")) { string Line; while ((Line = Reader.ReadLine()) != null) { if (Line.Contains(Value)) { Line = Line.Replace(Value, ""); return Line; } } } return Value; } } }