How to create a Users access history from a Desktop app

Asked

Viewed 221 times

0

I am creating a desktop application (Commercial System) using C#. I have a table of Users registration in which will be registered all employees who will log in to the system. In the registration screen, I would like a HISTORY tab and list all the accesses of that user during a period... It would be similar to the image below: inserir a descrição da imagem aqui

To store the history, what would be the best way:

1 - Create a table in the same Database (ex: User) and save everything in it;

2 - Write a log file and read it;

3 - ... Or another way of doing.

I’m sorry if this is a silly question, but I worry a lot about always doing it right so I don’t have problems and especially lose performance.

Thank you :)

1 answer

0


It creates a system log table, not just the user’s, and stores events in it... in some systems, I have a structure with the following data:

data do servidor,
data do computador,
ip do computador,
id do usuario,
nome do computador,
tabela (usuarios,notas_fiscais,caixa,clientes,etc),
evento (insercao, alteracao, delecao,select,login, etc),
descricao (ex: alterou o nome do cliente de A para B),
id relacionado (pk do registro que sofreu alteração / inserção),

finally, you can store various information, in your case, applied to this structure, just select the user events (user id) with the login event for example.

works really well for me, I hope it helps.

  • Thanks for the tip Rovann!!!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.