private void Form1_DragEnter(object sender, DragEventArgs e)
{
if (e.Data.GetDataPresent(DataFormats.FileDrop)) e.Effect = DragDropEffects.Link;
else e.Effect = DragDropEffects.None;
}
private void Form1_DragDrop(object sender, DragEventArgs e)
{
string[] filePath = (string[])e.Data.GetData(DataFormats.FileDrop);
foreach (string f in filePath)
{
File.Copy(f, Application.StartupPath + "\\rec_idc\\new\\60.jpg", true);
}
try
{
zx();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
private void Form1_Load(object sender, EventArgs e)
{
}
本文来讲一下通过系统自身的CMD方案来进行身份证的信息识别及信息输出,在图片清晰度达到的时候,识别率高达99%。
核心代码如下:
Process process = new Process();//实例
process.StartInfo.CreateNoWindow = true;//设定不显示窗口
process.StartInfo.UseShellExecute = false;
process.StartInfo.FileName = "c:\\Windows\\System32\\cmd.exe"; //设定程序名
process.StartInfo.RedirectStandardInput = true; //重定向标准输入
process.StartInfo.RedirectStandardOutput = true; //重定向标准输出
process.StartInfo.RedirectStandardError = true;//重定向错误输出
process.Start();
process.StandardInput.WriteLine(@"cd rec_idc ");
process.StandardInput.WriteLine(@"test.exe ");
身份证识别方案展示视频
下面是身份证识别源码,需要的朋友可以下载使用。