我有一个C#表单可以进行面部识别,是否可以在检测到面部后立即自动登录? (我已经创建了自动登录功能)。
我将提供凭证提供程序和表单代码(这是一个简单的表单)。
如果您有任何想法,我将不胜感激。
我从这里得到了ideia
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using FaceRecognition;
namespace reconhecimentoFacialC
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void label3_Click(object sender, EventArgs e)
{
}
FaceRec faceRec = new FaceRec();
private void button1_Click(object sender, EventArgs e)
{
faceRec.openCamera(pictureBox1, pictureBox2);
}
private void button1_Click_1(object sender, EventArgs e)
{
faceRec.Save_IMAGE(textBox1.Text);
MessageBox.Show("save sucess");
}
private void button2_Click(object sender, EventArgs e)
{
faceRec.isTrained = true;
}
private void Form1_Load(object sender, EventArgs e)
{
}
}
}
namespace TestConsoleApp
{
using System;
class Program
{
static void Main()
{
var networkCredential = CredentialsDialog.GetCredentials("Hey!", "We would like a login.");
if (networkCredential != null)
{
Console.WriteLine($"Username: \'{networkCredential.UserName}\'");
}
else
{
Console.WriteLine("No credential detected.");
}
Console.WriteLine("Press any key to continue...");
Console.ReadKey();
}
}
}
}
这是 Program.cs 代码的一小部分,覆盖它的最佳方法是什么?
您能说得更具体一些吗?看来你有两种形式?背景中的那个黑框也是一个表格吗? 您可以尝试使用 .ShowDialog 打开表单,但最近打开的表单无论如何都会位于顶部......