如何为用户记录登录时间

编程入门 行业动态 更新时间:2024-10-24 10:27:47
本文介绍了如何为用户记录登录时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我已成为用户登录控件,但我需要记录用户登录时的时间并将时间登录保存在表中 我只需要执行此操作的过程吗?

I was make a Control For User Login but I need TO record the time when the User logs in and save the time login in the table Just I need procedure to do this ?

推荐答案

由于您将问题标记为VB.Net,因此我了解您不需要T-SQL查询来回答您的问题. 我不知道您在哪一点上遇到困难; 您的步骤如下; 如果需要,请使用,ID,UserID,UserName,LoginTime字段创建一个表,可以将此表与Users表链接,并使用UseriD作为外键. 在您的登录页面.连接到您的数据库,然后对指定的表进行插入查询.像 Since you tagged your question as VB.Net, I understand that you dont need a T-SQL query to answer your question. I dont know in which point you had difficulty though; Your steps as follows; Create a table with the fields of , ID, UserID, UserName, LoginTime if you need you can link this table with your Users table and use UseriD as a foreign key. In your login page. Connect to your DB, and make a insert query to the specified table. Something like Try Mycn = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=[your db].mdb;") Mycn.Open() SQLstr = "INSERT INTO Table1 (field1, field2,field3) VALUES(''" & TextBox1.Text & "'',''" & TextBox2.Text & "'',''" & TextBox3.Text & "'')" Command = New OleDbCommand(SQLstr, Mycn) icount = Command.ExecuteNonQuery MessageBox.Show(icount) Catch ex As Exception MsgBox(ex) Mycn.Close() End Try

更多推荐

如何为用户记录登录时间

本文发布于:2023-11-06 06:58:50,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1563002.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:何为   时间   用户

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!