C#指纹仪 代码走不进去 是为何?
SqlCommand sqlFingerCheck = new SqlCommand("select [D_id],[D_name],[Fingerprint],[CI_time],[GO_time] from T_Doctor where [Fingerprint]<>'' and GETDATE() between CI_time and GO_time", conn);SqlDataReader sdr = sqlFingerCheck.ExecuteReader();
if (!sdr.HasRows)
{
//g = p.CreateGraphics();
g.DrawString("有效期内没有信息!", new Font("黑体", 15, FontStyle.Bold), new SolidBrush(Color.Red), new Point(p.Width / 2, p.Height / 2));
}
else
{
while (sdr.Read())//用sqldatareader必须用
{
//g = p.CreateGraphics();
oFinger = sdr["Fingerprint"].ToString();
if (axZKFPEngX1.VerFingerFromStr(ref oFinger, Ntemp, false, ref temp))
{
FingerGot = true;
}
}
if (FingerGot)
{
g.DrawString("√", new Font("黑体", 60, FontStyle.Bold), new SolidBrush(Color.Green), new Point(p.Width / 2, p.Height / 2));
}
else
{
g.DrawString("×", new Font("黑体", 60, FontStyle.Bold), new SolidBrush(Color.Red), new Point(p.Width / 2, p.Height / 2));
}
}
g.Dispose();
conn.Close();
}