private void btnFile_Click(object sender, EventArgs e) { if (!(File.Exists(this.txtPicPath.Text.Trim()))) { this.richTextBox1.Text += "[" + DateTime.Now.ToString("HH:mm:ss") + "]文件[" + this.txtPicPath.Text.Trim() + "]不存在" + "\r\n"; return; } string str = NetRecognizePic.CJY_RecognizeFile(this.txtPicPath.Text.Trim(), this.txtqUser.Text.Trim(), this.MD5String(this.txtqPwd.Text.Trim()), this.txtlpSoftId.Text.Trim(), this.txtlpCodeType.Text.Trim(), "0", "0", ""); string strerr = GetTextByKey(str, "err_str"); if (strerr != "OK") { this.richTextBox1.Text += "[" + DateTime.Now.ToString("HH:mm:ss") + "]" + strerr + "\r\n"; //MessageBox.Show(strerr); return; } string strpic_id = GetTextByKey(str, "pic_id"); this.txtPicID.Text = strpic_id; string strpic_str = GetTextByKey(str, "pic_str"); this.txtshibie.Text = strpic_str; this.richTextBox1.Text += "[" + DateTime.Now.ToString("HH:mm:ss") + "]识别结果:" + strpic_str + "\r\n"; }
private void button6_Click(object sender, EventArgs e) { string str = NetRecognizePic.CJY_ReportError(this.txtqUser.Text.Trim(), this.MD5String(this.txtqPwd.Text.Trim()), this.txtPicID.Text.Trim(), this.txtlpSoftId.Text.Trim()); string stradd = ""; if (GetTextByKey(str, "err_no") == "0") { stradd = "图片ID[" + this.txtPicID.Text.Trim() + "]报错成功"; this.richTextBox1.Text += "[" + DateTime.Now.ToString("HH:mm:ss") + "]" + stradd + "\r\n"; } }
private void txtPay_Click(object sender, EventArgs e) { string str = NetRecognizePic.CJY_UserPay(this.txtqUser.Text.Trim(), this.txtlpCard.Text.Trim()); string stradd = ""; if (GetTextByKey(str, "err_no") == "0") { stradd = "充值成功"; } else { stradd = GetTextByKey(str, "err_str"); } this.richTextBox1.Text += "[" + DateTime.Now.ToString("HH:mm:ss") + "]" + stradd + "\r\n"; }
private void btnZhuce_Click(object sender, EventArgs e) { string str = NetRecognizePic.CJY_UserReg(this.txtzUser.Text.Trim(), this.txtzPwd.Text.Trim()); string stradd = ""; if (GetTextByKey(str, "err_no") == "0") { stradd = "注册成功[账号:" + this.txtzUser.Text.Trim() + ",密码:" + this.txtzPwd.Text.Trim() + "],请您及时到官方网站(http://www.chaojiying.com)做必要的安全设置"; } else { stradd = GetTextByKey(str, "err_str"); } this.richTextBox1.Text += "[" + DateTime.Now.ToString("HH:mm:ss") + "]" + stradd + "\r\n"; }
private void btnQuery_Click(object sender, EventArgs e) { string str = NetRecognizePic.CJY_GetScore(this.txtqUser.Text.Trim(), this.MD5String(this.txtqPwd.Text.Trim())); string stradd = ""; if (GetTextByKey(str, "err_no") == "0") { stradd = "题分" + GetTextByKey(str, "tifen"); } else { stradd = GetTextByKey(str, "err_str"); } this.richTextBox1.Text += "[" + DateTime.Now.ToString("HH:mm:ss") + "]" + stradd + "\r\n"; }
private void btnBytes_Click(object sender, EventArgs e) { if (!(File.Exists(this.txtPicPath.Text.Trim()))) { this.richTextBox1.Text += "[" + DateTime.Now.ToString("HH:mm:ss") + "]文件[" + this.txtPicPath.Text.Trim() + "]不存在" + "\r\n"; return; } FileStream stream = null; try { stream = new FileStream(this.txtPicPath.Text.Trim(), FileMode.Open, FileAccess.Read); _blob = new byte[stream.Length]; stream.Read(_blob, 0, (int)stream.Length); } catch (Exception ex) { } finally { stream.Close(); } string str = NetRecognizePic.CJY_RecognizeBytes(_blob, _blob.Length, this.txtqUser.Text.Trim(), this.MD5String(this.txtqPwd.Text.Trim()), this.txtlpSoftId.Text.Trim(), this.txtlpCodeType.Text.Trim(), "0", "0", ""); string strerr = GetTextByKey(str, "err_str"); if (strerr != "OK") { this.richTextBox1.Text += "[" + DateTime.Now.ToString("HH:mm:ss") + "]" + strerr + "\r\n"; //MessageBox.Show(strerr); return; } string strpic_id = GetTextByKey(str, "pic_id"); this.txtPicID.Text = strpic_id; string strpic_str = GetTextByKey(str, "pic_str"); this.txtshibie.Text = strpic_str; this.richTextBox1.Text += "[" + DateTime.Now.ToString("HH:mm:ss") + "]识别结果:" + strpic_str + "\r\n"; }