Пример #1
0
        private void ShowByUserId(int userid)
        {
            string sql = "SELECT NAME  FROM[HSBS].[dbo].[USERINFO] where USERID = " + userid + "";

            label3.Text = "你是" + (string)SQLRepository.ExecuteScalarToObject(SQLRepository.hsbs_strConn, CommandType.Text, sql, null);

            sql = "select top 1 " + ConfigurationManager.AppSettings["DBColumnsNanme"] + " from userfile";
            dt  = SQLRepository.ExecuteQueryToDataTable(SQLRepository.test_strConn, sql);


            dataGridView1.DataSource = dt;


            string ColumnsNanme = ConfigurationManager.AppSettings["ColumnsNanme"];

            string[] arr = ColumnsNanme.Split(',');
            for (int i = 0; i < arr.Length; i++)
            {
                dataGridView1.Columns[i].HeaderCell.Value = arr[i].Trim();
            }


            remaining_time = int.Parse(ConfigurationManager.AppSettings["KEEP_TIME_SEC"]);
            button1.Text   = "退出并注销(" + remaining_time-- + "秒)";


            panel2.Visible = true;


            T.Enabled = false;
            T.Stop();
            T.Enabled = true;
            T.Start();


            Thread Thread = new Thread(new ThreadStart(detect));

            Thread.IsBackground = true;
            Thread.Start();
        }
Пример #2
0
        static public int Verify() // 返回0 匹配失败,否则返回userid
        {
            string    sql = @"select user_id, Template_Data  FROM Biotemplate where nOldType > 3";
            DataTable dt  = SQLRepository.ExecuteQueryToDataTable(SQLRepository.hsbs_strConn, sql);


            for (int i = 0; i < dt.Rows.Count; i++)
            {
                object o = dt.Rows[i]["Template_Data"];
                if (!Convert.IsDBNull(o) && o != null)
                {
                    RegTmp = zkfp2.Base64ToBlob((string)o);
                    int ret = zkfp2.DBMatch(mDBHandle, CapTmp, RegTmp);

                    if (0 < ret)//匹配成功
                    {
                        return(Convert.ToInt32(dt.Rows[i]["user_id"]));
                    }
                }
            }
            return(0);
        }