using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;
using System.Configuration;
namespace _2012._2._21登录限制
{
public partial class Form1 : Form
{
string strcnn = string.Empty;
int errorcount = 0;
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
strcnn = ConfigurationManager.ConnectionStrings["strconn"].ConnectionString;
int Sqlerror = Geterror();
if (Sqlerror>=3)
{
DateTime sqltime = GetdataError();//时间差
TimeSpan span = DateTime.Now.Subtract(sqltime);
double shijiancha = span.TotalSeconds;
//int shijiancha = GetErrorTime();
if (shijiancha<15)
{
MessageBox.Show("您已经连续3次输入错误密码,已被系锁定¨15秒后请重新输入!");
return;