public void LoadSettings() { PropertiesFile props = new PropertiesFile(AppDomain.CurrentDomain.BaseDirectory + "properties.properties"); Host = props.get("Host", "127.0.0.1"); Port = int.Parse(props.get("Port", "25565")); IsComPrinter = bool.Parse(props.get("IsComPrinter", "False")); ComPort = props.get("ComPort", "COM1"); ComBaudRate = int.Parse(props.get("ComBaudRate", "4800")); }
public void SaveSettings() { PropertiesFile props = new PropertiesFile(AppDomain.CurrentDomain.BaseDirectory + "properties.properties"); props.set("Host", Host); props.set("Port", Port.ToString()); props.set("IsComPrinter", IsComPrinter.ToString()); props.set("ComPort", ComPort); props.set("ComBaudRate", ComBaudRate.ToString()); props.Save(); }