public static bool WriteNetConfig(UploadConfigModel config)
        {
            try
            {
                string config_path = global_path + "\\uploadConfig.ini";
                WritePrivateProfileString("联网配置", "待检车辆来源", ((int)config.WaitCarModel).ToString(), config_path);
                WritePrivateProfileString("联网配置", "待检车辆接口地址", config.JkdzWaitCar, config_path);
                WritePrivateProfileString("联网配置", "待检车辆接口序列号", config.JkxlhWaitCar, config_path);

                WritePrivateProfileString("联网配置", "联网模式", ((int)config.NetModel).ToString(), config_path);
                WritePrivateProfileString("联网配置", "接口序列号", config.Jkxlh, config_path);
                WritePrivateProfileString("联网配置", "接口地址", config.Jkdz, config_path);

                WritePrivateProfileString("联网配置", "大雷是否发送18JXX", config.dl_Send18Jxx?"Y":"N", config_path);
                WritePrivateProfileString("联网配置", "大雷是否发送18H05", config.dl_Send18H05 ? "Y" : "N", config_path);

                WritePrivateProfileString("联网配置", "联网地区", ((int)config.NetArea).ToString(), config_path);

                WritePrivateProfileString("联网配置", "照片上传次数", config.PicSendTimes.ToString(), config_path);

                return(true);
            }
            catch (Exception er)
            {
                WriteLogs("保存联网上传联网配置失败:" + er.Message);
                return(false);
            }
        }
        public static bool WriteBaseConfig(UploadConfigModel config)
        {
            try
            {
                string config_path = global_path + "\\uploadConfig.ini";

                WritePrivateProfileString("联网配置", "检测站编号", config.StationID, config_path);
                WritePrivateProfileString("联网配置", "检测线编号", config.LineID, config_path);
                WritePrivateProfileString("联网配置", "外廓工位号", config.WkDeviceID, config_path);
                WritePrivateProfileString("联网配置", "整备质量工位号", config.ZbzlDeviceID, config_path);
                WritePrivateProfileString("联网配置", "外廓前照编号", config.WkFrontPicBh, config_path);
                WritePrivateProfileString("联网配置", "外廓后照编号", config.WkBackPicBh, config_path);
                WritePrivateProfileString("联网配置", "整备质量前照编号", config.ZbzlFrontPicBh, config_path);
                WritePrivateProfileString("联网配置", "整备质量后照编号", config.ZbzlBackPicBh, config_path);

                WritePrivateProfileString("联网配置", "系统类别", config.Xtlb, config_path);

                WritePrivateProfileString("联网配置", "场景编号", config.CJBH, config_path);
                WritePrivateProfileString("联网配置", "单位名称", config.DWMC, config_path);
                WritePrivateProfileString("联网配置", "单位机构代码", config.DWJGDM, config_path);
                WritePrivateProfileString("联网配置", "用户标识", config.YHBS, config_path);
                WritePrivateProfileString("联网配置", "用户姓名", config.YHXM, config_path);
                WritePrivateProfileString("联网配置", "终端标识", config.ZDBS, config_path);

                WritePrivateProfileString("联网配置", "本机IP地址", config.LocalIP, config_path);
                WritePrivateProfileString("联网配置", "外廓代号", config.WKDH, config_path);
                WritePrivateProfileString("联网配置", "整备质量代号", config.ZBZLDH, config_path);

                return(true);
            }
            catch (Exception er)
            {
                WriteLogs("保存联网上传基本配置失败:" + er.Message);
                return(false);
            }
        }
        public static UploadConfigModel getUploadConfig()
        {
            try
            {
                UploadConfigModel config = new UploadConfigModel();

                string        config_path = global_path + "\\uploadConfig.ini";
                StringBuilder temp        = new StringBuilder();
                temp.Length = 2048;
                int i = 0;

                GetPrivateProfileString("联网配置", "待检车辆来源", "0", temp, 2048, config_path);
                if (int.TryParse(temp.ToString().Trim(), out i))
                {
                    config.WaitCarModel = (NetWaitCarModel)i;
                }
                else
                {
                    config.WaitCarModel = NetWaitCarModel.联网查询;
                }

                GetPrivateProfileString("联网配置", "待检车辆接口地址", "", temp, 2048, config_path);
                config.JkdzWaitCar = temp.ToString().Trim();

                GetPrivateProfileString("联网配置", "待检车辆接口序列号", "", temp, 2048, config_path);
                config.JkxlhWaitCar = temp.ToString().Trim();


                GetPrivateProfileString("联网配置", "联网模式", "0", temp, 2048, config_path);
                if (int.TryParse(temp.ToString().Trim(), out i))
                {
                    config.NetModel = (NetUploadModel)i;
                }
                else
                {
                    config.NetModel = NetUploadModel.安车;
                }

                GetPrivateProfileString("联网配置", "联网地区", "0", temp, 2048, config_path);
                if (int.TryParse(temp.ToString().Trim(), out i))
                {
                    config.NetArea = (NetAreaModel)i;
                }
                else
                {
                    config.NetArea = NetAreaModel.四川;
                }

                GetPrivateProfileString("联网配置", "接口地址", "", temp, 2048, config_path);
                config.Jkdz = temp.ToString().Trim();

                GetPrivateProfileString("联网配置", "接口序列号", "", temp, 2048, config_path);
                config.Jkxlh = temp.ToString().Trim();

                GetPrivateProfileString("联网配置", "本机IP地址", "", temp, 2048, config_path);
                config.LocalIP = temp.ToString().Trim();

                GetPrivateProfileString("联网配置", "系统类别", "18", temp, 2048, config_path);
                config.Xtlb = temp.ToString().Trim();

                GetPrivateProfileString("联网配置", "检测站编号", "", temp, 2048, config_path);
                config.StationID = temp.ToString().Trim();

                GetPrivateProfileString("联网配置", "检测线编号", "", temp, 2048, config_path);
                config.LineID = temp.ToString().Trim();

                GetPrivateProfileString("联网配置", "外廓工位号", "1", temp, 2048, config_path);
                config.WkDeviceID = temp.ToString().Trim();

                GetPrivateProfileString("联网配置", "整备质量工位号", "1", temp, 2048, config_path);
                config.ZbzlDeviceID = temp.ToString().Trim();

                GetPrivateProfileString("联网配置", "外廓前照编号", "360", temp, 2048, config_path);
                config.WkFrontPicBh = temp.ToString().Trim();

                GetPrivateProfileString("联网配置", "外廓后照编号", "361", temp, 2048, config_path);
                config.WkBackPicBh = temp.ToString().Trim();

                GetPrivateProfileString("联网配置", "整备质量前照编号", "362", temp, 2048, config_path);
                config.ZbzlFrontPicBh = temp.ToString().Trim();

                GetPrivateProfileString("联网配置", "整备质量后照编号", "363", temp, 2048, config_path);
                config.ZbzlBackPicBh = temp.ToString().Trim();

                GetPrivateProfileString("联网配置", "照片上传次数", "1", temp, 2048, config_path);
                if (int.TryParse(temp.ToString().Trim(), out i) && i > 0)
                {
                    config.PicSendTimes = i;
                }
                else
                {
                    config.PicSendTimes = 1;
                }

                GetPrivateProfileString("联网配置", "场景编号", "", temp, 2048, config_path);
                config.CJBH = temp.ToString().Trim();

                GetPrivateProfileString("联网配置", "单位名称", "", temp, 2048, config_path);
                config.DWMC = temp.ToString().Trim();

                GetPrivateProfileString("联网配置", "单位机构代码", "", temp, 2048, config_path);
                config.DWJGDM = temp.ToString().Trim();

                GetPrivateProfileString("联网配置", "用户标识", "", temp, 2048, config_path);
                config.YHBS = temp.ToString().Trim();

                GetPrivateProfileString("联网配置", "用户姓名", "", temp, 2048, config_path);
                config.YHXM = temp.ToString().Trim();

                GetPrivateProfileString("联网配置", "终端标识", "", temp, 2048, config_path);
                config.ZDBS = temp.ToString().Trim();

                GetPrivateProfileString("联网配置", "外廓代号", "M1", temp, 2048, config_path);
                config.WKDH = temp.ToString().Trim();
                GetPrivateProfileString("联网配置", "整备质量代号", "Z1", temp, 2048, config_path);
                config.ZBZLDH = temp.ToString().Trim();
                GetPrivateProfileString("联网配置", "大雷是否发送18JXX", "N", temp, 2048, config_path);
                config.dl_Send18Jxx = temp.ToString().Trim() == "Y";
                GetPrivateProfileString("联网配置", "大雷是否发送18H05", "N", temp, 2048, config_path);
                config.dl_Send18H05 = temp.ToString().Trim() == "Y";
                return(config);
            }
            catch (Exception er)
            {
                WriteLogs("获取联网配置出错:" + er.Message);
                return(null);
            }
        }