如何实现写入登录后的时间IP和次数?
string Userid = this.Userid.Value.ToString();string PassWD = this.Userpwd.Value.ToString();
SqlConnection strcon = new SqlConnection(System.Configuration.ConfigurationManager.AppSettings["strcon"]);
strcon.Open();
SqlCommand scd = new SqlCommand("select count(*) from Users where Userid='" + Userid + "' and PassWD='" + PassWD + "' and IsGood=0 ", strcon);
int count = Convert.ToInt32(scd.ExecuteScalar());
// SqlDataReader dr = scd.ExecuteReader();
if (count > 0)
// int times = 0;
// try
{
// if (!dr.Read())
count = 1;
string LoginDate = DateTime.Now;
Session.Timeout = 30;
Session["Userid"] = this.Userid.Value.ToString();
Session["VNum"] = null;
Response.Redirect("~/index.aspx");
}
下面应该怎么样能写入登录的时间.IP和次数