public bool writeCheckRecord(selfCheckRecord cgjcheckdata) { try { ini.INIIO.WritePrivateProfileString("自检结果", "时间", cgjcheckdata.Checkdatetime, startUpPath + "/detectConfig.ini"); ini.INIIO.WritePrivateProfileString("自检结果", "测功机", cgjcheckdata.Cgjcheckrecord ? "Y" : "N", startUpPath + "/detectConfig.ini"); ini.INIIO.WritePrivateProfileString("自检结果", "废气仪", cgjcheckdata.Fqycheckrecord ? "Y" : "N", startUpPath + "/detectConfig.ini"); ini.INIIO.WritePrivateProfileString("自检结果", "烟度计", cgjcheckdata.Ydjcheckrecord ? "Y" : "N", startUpPath + "/detectConfig.ini"); ini.INIIO.WritePrivateProfileString("自检结果", "流量计", cgjcheckdata.Lljcheckrecord ? "Y" : "N", startUpPath + "/detectConfig.ini"); return(true); } catch { return(false); } }
public selfCheckRecord getCheckRecord() { selfCheckRecord configinidata = new selfCheckRecord(); //parasiticData configinidata = new parasiticData(); StringBuilder temp = new StringBuilder(); temp.Length = 2048; ini.INIIO.GetPrivateProfileString("自检结果", "时间", "", temp, 2048, startUpPath + "/detectConfig.ini"); configinidata.Checkdatetime = temp.ToString(); ini.INIIO.GetPrivateProfileString("自检结果", "测功机", "", temp, 2048, startUpPath + "/detectConfig.ini"); configinidata.Cgjcheckrecord = (temp.ToString() == "Y"); ini.INIIO.GetPrivateProfileString("自检结果", "废气仪", "", temp, 2048, startUpPath + "/detectConfig.ini"); configinidata.Fqycheckrecord = (temp.ToString() == "Y"); ini.INIIO.GetPrivateProfileString("自检结果", "烟度计", "", temp, 2048, startUpPath + "/detectConfig.ini"); configinidata.Ydjcheckrecord = (temp.ToString() == "Y"); ini.INIIO.GetPrivateProfileString("自检结果", "流量计", "", temp, 2048, startUpPath + "/detectConfig.ini"); configinidata.Lljcheckrecord = (temp.ToString() == "Y"); return(configinidata); }