//load the configure file public void Load() { try { XmlReader reader = XmlReader.Create("Config.xml"); XmlSerializer serializer = new XmlSerializer(typeof(Configure)); Configure temp = (Configure)serializer.Deserialize(reader); Data = temp.Data; LocationID = temp.LocationID; Opened = temp.Opened; PortName = temp.PortName; LogDataType = temp.LogDataType; reader.Close(); } catch (Exception e) { Debug.Print("Fail to load configure file."); } }