/// <summary> /// 创建测试信息 /// </summary> /// <param name="BaseMessagepath">文件名,.ini文件</param> public static void CreateBaseMessageIni(string BaseMessagepath) { if (!File.Exists(BaseMessagepath)) { INIFiLE myini = new INIFiLE(BaseMessagepath); myini.WriteString("information", "注意事项", "试验名称为必填项,删除”NULL“写入需要的信息"); myini.WriteString("information", "测试时间", DateTime.Now.ToString("yyyy-MM-dd")); myini.WriteString("information", "试验名称", "NULL"); myini.WriteString("information", "试验人员", "NULL"); myini.WriteString("information", "试验单位", "NULL"); myini.WriteString("information", "审核人", "NULL"); myini.WriteString("information", "批准人", "NULL"); myini.WriteString("information", "负责人", "NULL"); myini.WriteString("information", "天气", "NULL"); myini.WriteString("information", "温度", "NULL"); myini.WriteString("information", "湿度", "NULL"); myini.WriteInt("information", "变压器油温(整数)", 23); } }
/// <summary> /// 创建测试信息 /// </summary> /// <param name="BaseMessagepath">文件名,.ini文件</param> public static void CreateBaseMessageIni(string BaseMessagepath, JobList job) { if (!File.Exists(BaseMessagepath)) { INIFiLE myini = new INIFiLE(BaseMessagepath); myini.WriteString("information", "注意事项", "试验名称为必填项,删除”NULL“写入需要的信息"); myini.WriteString("information", "测试时间", DateTime.Now.ToString("yyyy-MM-dd")); myini.WriteString("information", "试验名称", job.Information.testingName); myini.WriteString("information", "试验人员", job.Information.tester); myini.WriteString("information", "试验单位", job.Information.testingAgency); myini.WriteString("information", "审核人", job.Information.auditor); myini.WriteString("information", "批准人", job.Information.approver); myini.WriteString("information", "负责人", job.Information.principal); myini.WriteString("information", "天气", job.Information.weather); myini.WriteString("information", "温度", job.Information.temperature); myini.WriteString("information", "湿度", job.Information.humidity); myini.WriteInt("information", "变压器油温(整数)", (int)job.Information.oilTemperature); } }