示例#1
0
        static void EscreveOutput(PrevisaoIPMA leitura)
        {
            string jsonData = JsonConvert.SerializeObject(leitura);

            File.WriteAllText(@"../outputs/" + leitura.globalIdLocal + ".json", jsonData);

            XmlDocument xmlDocument = JsonConvert.DeserializeXmlNode(jsonData, "root");

            xmlDocument.Save(@"../outputs/" + leitura.globalIdLocal + ".xml");
        }
示例#2
0
        static PrevisaoIPMA LerFicheiroPrevisao(int globalID)
        {
            String jsonString = null;

            using (StreamReader reader = new StreamReader(@"../data_forecast/" + globalID + ".json"))
                jsonString = reader.ReadToEnd();

            PrevisaoIPMA obj = System.Text.Json.JsonSerializer.Deserialize <PrevisaoIPMA>(jsonString);

            return(obj);
        }