/// <summary> /// 保存并上传图片 /// </summary> private void saveUploadJpg(object objImg) { try { string strBaseImg = objImg.ToString(); byte[] byteImg = Convert.FromBase64String(strBaseImg); ReadIniFile readIni = new ReadIniFile(strPath + "\\sdnsystem.ini"); string strIP = readIni.ReadValue("uploadimgs", "ip"); string strPort = readIni.ReadValue("uploadimgs", "port"); string strAdd = readIni.ReadValue("uploadimgs", "requestpath"); string strAddress = "http://" + strIP + ":" + strPort + strAdd; string strFilePath; // MessageBox.Show(strAddress); if (iDevType == 0) { //主摄像头 证件照 strFilePath = "2_sdn1234555.jpg"; } else { //人员照片 strFilePath = "1_sdn1234555.jpg"; } new sdnHttpUploadFIle().Upload_Request(strAddress, byteImg, strFilePath); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
/// <summary> /// 窗口加载 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void DoccameraOcx_Load(object sender, EventArgs e) { ReadIniFile readIni = new ReadIniFile(strPath + "\\sdnsystem.ini"); sdn_dual = readIni.ReadValue("dualcamera", "dual"); //是否具有双目活体检测功能 sdn_verify = readIni.ReadValue("dualcamera", "verify"); //是否具有人证比对功能 sdn_readCardType = readIni.ReadValue("dualcamera", "type"); //获取身份证方式 //修改控件大小 }