示例#1
0
        private void ReadSettings(bool writeIfNotExist = true)
        {
            if (writeIfNotExist)
            {
                XMLSettings.WriteDefaultSettings();
            }

            XMLSettings.ListenPort = ushort.Parse(XMLSettings.ReadValue("ListenPort"));
            XMLSettings.ShowToU    = bool.Parse(XMLSettings.ReadValue("ShowToU"));
            XMLSettings.AutoListen = bool.Parse(XMLSettings.ReadValue("AutoListen"));
            XMLSettings.ShowPopup  = bool.Parse(XMLSettings.ReadValue("ShowPopup"));
            XMLSettings.UseUPnP    = bool.Parse(XMLSettings.ReadValue("UseUPnP"));

            XMLSettings.ShowToolTip   = bool.Parse(XMLSettings.ReadValueSafe("ShowToolTip", "False"));
            XMLSettings.IntegrateNoIP = bool.Parse(XMLSettings.ReadValueSafe("EnableNoIPUpdater", "False"));
            XMLSettings.NoIPHost      = XMLSettings.ReadValueSafe("NoIPHost");
            XMLSettings.NoIPUsername  = XMLSettings.ReadValueSafe("NoIPUsername");
            XMLSettings.NoIPPassword  = XMLSettings.ReadValueSafe("NoIPPassword");

            XMLSettings.Password = XMLSettings.ReadValue("Password");
        }