using System; using System.IO; using System.Runtime.InteropServices; using System.Text; namespace DuckEmulator.HabboHotel.Inside.Helpers { public static class IO { public static string workingDirectory { get { return Environment.CurrentDirectory; } } [DllImport("kernel32")] private static extern long WritePrivateProfileString(string section, string key, string val, string filePath); [DllImport("kernel32")] private static extern int GetPrivateProfileString(string section, string key, string def, StringBuilder retVal, int size, string filePath); public static string readINI(string iniSection, string iniKey, string iniLocation) { var retVal = new StringBuilder(byte.MaxValue); try { GetPrivateProfileString(iniSection, iniKey, "", retVal, byte.MaxValue, iniLocation); return (retVal).ToString(); } catch { return ""; } } public static void writeINI(string iniSection, string iniKey, string iniValue, string iniLocation) { WritePrivateProfileString(iniSection, iniKey, iniValue, iniLocation); } public static bool fileExists(string fileLocation) { return File.Exists(fileLocation); } } }