• 大小: 5.17M
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-09-26
  • 语言: 其他
  • 标签: 其他  

资源简介

HANVONSDK20141119.rar

资源截图

代码片段和文件信息

/* ----------------------------------------------------------
 * 文件名称:Form1.cs
 * 作者:秦建辉
 * 
 * QQ:36748897
 * 
 * 博客:http://www.firstsolver.com/wordpress/
 * 
 * 开发环境:
 *      Visual Studio V2013
 *      .NET framework 4.0
 *      
 * 版本历史: 
 *      V1.0 2014年09月12日
 *              人脸通SDK演示:人脸模板导入导出
------------------------------------------------------------ */
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Text.Regularexpressions;
using System.Windows.Forms;

namespace Splash
{
    public partial class Form1 : Form
    {
        /// 
        /// 设备通信字符集编码为简体中文GB2312
        /// 

        public const Int32 DeviceCodePage = 936;

        public Form1()
        {
            InitializeComponent();
        }

        private void buttonExport_Click(object sender EventArgs e)
        {
            // 检测导出文件路径
            String SaveFileName;
            try
            {
                SaveFileName = Path.GetFullPath(textBoxExportFileName.Text);
            }
            catch
            {
                MessageBox.Show(“不正确的导出文件路径!“ “错误“ MessageBoxButtons.OK MessageBoxIcon.Error);
                return;
            }

            // 连接到设备
            try
            {
                using (FaceId Client = new FaceId(textBoxExportIP.Text Convert.ToInt32(textBoxExportPort.Text)))
                {
                    // 获取员工工号集合
                    String Answer;
                    FaceId_ErrorCode ErrorCode = Client.Execute(“GetEmployeeID()“ out Answer DeviceCodePage);
                    if (ErrorCode == FaceId_ErrorCode.Success)
                    {   // 获取所有数据项
                        FaceId_Item[] ItemCollection = FaceId_Item.GetAllItems(Answer);
                        if (ItemCollection != null)
                        {   // 成功导出的人员数
                            Int32 SaveIdCount = 0;

                            // 基于LINQ查询提取员工工号集合
                            String[] EmployeeIdCollection = (from item in ItemCollection where (item.Name.Equals(“id“)) select item.Value).ToArray();
                            using (StreamWriter sw = new StreamWriter(SaveFileName false Encoding.UTF8))
                            {
                                foreach (String EmployeeId in EmployeeIdCollection)
                                {
                                    ErrorCode = Client.Execute(“GetEmployee(id=\““ + EmployeeId + “\“)“ out Answer DeviceCodePage);
                                    if (ErrorCode == FaceId_ErrorCode.Success)
                                    {
                                        sw.WriteLine(Answer);
                                        SaveIdCount++;
                                    }
                                }
                            }

                            String Content = “成功导出人员“ + SaveIdCount + “

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件     763904  2014-09-15 16:24  FaceDemo-CS-20141104\Example Executor\EXIMPORT.exe

     文件      22528  2014-06-11 15:02  FaceDemo-CS-20141104\Example Executor\FaceId.dll

     文件     757248  2014-11-04 20:35  FaceDemo-CS-20141104\Example Executor\GetRecord.exe

     文件     757248  2014-09-15 16:22  FaceDemo-CS-20141104\Example Executor\TcpClientDemo.exe

     文件     762368  2014-09-15 16:22  FaceDemo-CS-20141104\Example Executor\TcpServerDemo.exe

     文件     761856  2014-09-15 16:22  FaceDemo-CS-20141104\Example Executor\UdpServerDemo.exe

     文件        199  2014-09-12 08:54  FaceDemo-CS-20141104\Example Project\FaceIdDemo\EXIMPORT\App.config

     文件       3881  2014-09-12 09:09  FaceDemo-CS-20141104\Example Project\FaceIdDemo\EXIMPORT\EXIMPORT.csproj

     文件     372526  2010-09-14 17:22  FaceDemo-CS-20141104\Example Project\FaceIdDemo\EXIMPORT\FireEyes.ico

     文件       9287  2014-09-13 12:16  FaceDemo-CS-20141104\Example Project\FaceIdDemo\EXIMPORT\Form1.cs

     文件      16636  2014-09-13 11:45  FaceDemo-CS-20141104\Example Project\FaceIdDemo\EXIMPORT\Form1.Designer.cs

     文件     564907  2014-09-13 11:45  FaceDemo-CS-20141104\Example Project\FaceIdDemo\EXIMPORT\Form1.resx

     文件        518  2014-07-24 12:04  FaceDemo-CS-20141104\Example Project\FaceIdDemo\EXIMPORT\Program.cs

     文件       1340  2014-07-24 10:52  FaceDemo-CS-20141104\Example Project\FaceIdDemo\EXIMPORT\Properties\AssemblyInfo.cs

     文件       2852  2014-09-12 08:54  FaceDemo-CS-20141104\Example Project\FaceIdDemo\EXIMPORT\Properties\Resources.Designer.cs

     文件       5612  2014-07-24 10:52  FaceDemo-CS-20141104\Example Project\FaceIdDemo\EXIMPORT\Properties\Resources.resx

     文件       1106  2014-09-12 08:54  FaceDemo-CS-20141104\Example Project\FaceIdDemo\EXIMPORT\Properties\Settings.Designer.cs

     文件        249  2014-07-24 10:52  FaceDemo-CS-20141104\Example Project\FaceIdDemo\EXIMPORT\Properties\Settings.settings

     文件       2953  2014-09-13 10:25  FaceDemo-CS-20141104\Example Project\FaceIdDemo\FaceIdDemo.sln

     文件        199  2014-09-13 10:25  FaceDemo-CS-20141104\Example Project\FaceIdDemo\GetRecord\App.config

     文件     372526  2014-09-13 10:27  FaceDemo-CS-20141104\Example Project\FaceIdDemo\GetRecord\FireEyes.ico

     文件       2762  2014-11-04 20:34  FaceDemo-CS-20141104\Example Project\FaceIdDemo\GetRecord\Form1.cs

     文件       6844  2014-09-13 11:43  FaceDemo-CS-20141104\Example Project\FaceIdDemo\GetRecord\Form1.Designer.cs

     文件     564907  2014-09-13 11:43  FaceDemo-CS-20141104\Example Project\FaceIdDemo\GetRecord\Form1.resx

     文件       3882  2014-09-13 11:11  FaceDemo-CS-20141104\Example Project\FaceIdDemo\GetRecord\GetRecord.csproj

     文件        518  2014-09-13 10:25  FaceDemo-CS-20141104\Example Project\FaceIdDemo\GetRecord\Program.cs

     文件       1342  2014-09-13 10:24  FaceDemo-CS-20141104\Example Project\FaceIdDemo\GetRecord\Properties\AssemblyInfo.cs

     文件       2852  2014-09-13 10:25  FaceDemo-CS-20141104\Example Project\FaceIdDemo\GetRecord\Properties\Resources.Designer.cs

     文件       5612  2014-09-13 10:24  FaceDemo-CS-20141104\Example Project\FaceIdDemo\GetRecord\Properties\Resources.resx

     文件       1106  2014-09-13 10:25  FaceDemo-CS-20141104\Example Project\FaceIdDemo\GetRecord\Properties\Settings.Designer.cs

............此处省略650个文件信息

评论

共有 条评论