public bool writeanalysismeterIni(demacatefqy analysismeterdata) { try { ini.INIIO.WritePrivateProfileString("标定数据", "CO2标值", analysismeterdata.Co2bz.ToString("0.00"), "C:/jcdatatxt/demacatefqy.ini"); ini.INIIO.WritePrivateProfileString("标定数据", "CO2测量值", analysismeterdata.Co2clz.ToString("0.00"), "C:/jcdatatxt/demacatefqy.ini"); ini.INIIO.WritePrivateProfileString("标定数据", "CO标值", analysismeterdata.Cobz.ToString("0.00"), "C:/jcdatatxt/demacatefqy.ini"); ini.INIIO.WritePrivateProfileString("标定数据", "CO测量值", analysismeterdata.Coclz.ToString("0.00"), "C:/jcdatatxt/demacatefqy.ini"); ini.INIIO.WritePrivateProfileString("标定数据", "HC标值", analysismeterdata.Hcbz.ToString("0.00"), "C:/jcdatatxt/demacatefqy.ini"); ini.INIIO.WritePrivateProfileString("标定数据", "HC测量值", analysismeterdata.Hcclz.ToString("0.00"), "C:/jcdatatxt/demacatefqy.ini"); ini.INIIO.WritePrivateProfileString("标定数据", "NO标值", analysismeterdata.Nobz.ToString("0.00"), "C:/jcdatatxt/demacatefqy.ini"); ini.INIIO.WritePrivateProfileString("标定数据", "NO测量值", analysismeterdata.Noclz.ToString("0.00"), "C:/jcdatatxt/demacatefqy.ini"); ini.INIIO.WritePrivateProfileString("标定数据", "校准点数", analysismeterdata.Jzds.ToString("0"), "C:/jcdatatxt/demacatefqy.ini"); ini.INIIO.WritePrivateProfileString("标定数据", "高低校准", analysismeterdata.Gdjz, "C:/jcdatatxt/demacatefqy.ini"); ini.INIIO.WritePrivateProfileString("标定数据", "备注说明", analysismeterdata.Bzsm, "C:/jcdatatxt/demacatefqy.ini"); ini.INIIO.WritePrivateProfileString("标定数据", "标定结果", analysismeterdata.Bdjg, "C:/jcdatatxt/demacatefqy.ini"); ini.INIIO.WritePrivateProfileString("标定数据", "Pef", analysismeterdata.Pef, "C:/jcdatatxt/demacatefqy.ini"); ini.INIIO.WritePrivateProfileString("标定数据", "Starttime", analysismeterdata.Starttime, "C:/jcdatatxt/demacatefqy.ini"); return(true); } catch { return(false); } }
public demacatefqy readAnalysisMeterData(string filePath) { demacatefqy vmas_data = new demacatefqy(); try { StringBuilder temp = new StringBuilder(); temp.Length = 2048; if (File.Exists(filePath)) { ini.INIIO.GetPrivateProfileString("标定数据", "CO2标值", "", temp, 2048, filePath);//、 vmas_data.Co2bz = float.Parse(temp.ToString()); ini.INIIO.GetPrivateProfileString("标定数据", "CO2测量值", "", temp, 2048, filePath); vmas_data.Co2clz = float.Parse(temp.ToString()); ini.INIIO.GetPrivateProfileString("标定数据", "CO标值", "", temp, 2048, filePath); vmas_data.Cobz = float.Parse(temp.ToString()); ini.INIIO.GetPrivateProfileString("标定数据", "CO测量值", "", temp, 2048, filePath); vmas_data.Coclz = float.Parse(temp.ToString()); ini.INIIO.GetPrivateProfileString("标定数据", "HC标值", "", temp, 2048, filePath); vmas_data.Hcbz = float.Parse(temp.ToString()); ini.INIIO.GetPrivateProfileString("标定数据", "HC测量值", "", temp, 2048, filePath); vmas_data.Hcclz = float.Parse(temp.ToString()); ini.INIIO.GetPrivateProfileString("标定数据", "NO标值", "", temp, 2048, filePath); vmas_data.Nobz = float.Parse(temp.ToString()); ini.INIIO.GetPrivateProfileString("标定数据", "NO测量值", "", temp, 2048, filePath); vmas_data.Noclz = float.Parse(temp.ToString()); ini.INIIO.GetPrivateProfileString("标定数据", "校准点数", "", temp, 2048, filePath); vmas_data.Jzds = int.Parse(temp.ToString()); ini.INIIO.GetPrivateProfileString("标定数据)", "高低校准", "", temp, 2048, filePath); vmas_data.Gdjz = temp.ToString(); ini.INIIO.GetPrivateProfileString("标定数据", "备注说明", "", temp, 2048, filePath); vmas_data.Bzsm = temp.ToString(); ini.INIIO.GetPrivateProfileString("标定数据", "标定结果", "", temp, 2048, filePath); vmas_data.Bdjg = temp.ToString(); ini.INIIO.GetPrivateProfileString("标定数据", "Pef", "", temp, 2048, filePath); vmas_data.Pef = temp.ToString(); ini.INIIO.GetPrivateProfileString("标定数据", "Starttime", "", temp, 2048, filePath); vmas_data.Starttime = temp.ToString(); } else { vmas_data.Bdjg = "-1"; } return(vmas_data); } catch { vmas_data.Bdjg = "-1"; return(vmas_data); } }