Click here to Skip to main content
15,906,708 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi I Am Yogesh Sharma I Have developed An C# Multi User Windows Application.. Now I Need to add an new functionality to my application..That Is:
i need that at server i need to keep the track of each user that are currently logged in,
i need to see which user is logged in currently at a particular time and also he/she is working on which form..Is It Possible...??Please Help..If Multithreading is the soluion.
Please provide some logic with example. I know just the basic concept of multithreading please provide details as not many know how to implement this task.
please help its urgent for me. even i am not getting help from google...
thanks in advanced...Any help will be highly appreciated..
Posted
Updated 18-Oct-12 4:14am
v3

Hi,

I have one solution but i don`t know its proper or not. I am sharing with you.

you can make one table like UserLog into the table.
That table contains the following columns.

UserLogID(PK), UserID(UserLoginID), Operatin(Which contains Add,Update,Delete,Login etc), Description(Any comments or description), CreatedDateTime(datetime)

Now you can make one common function to insert record in this this table.
In your project you can call this function and insert values. so can keep the track of every user.

For Example. User login. So after verifying username and password you can call this function with following parameters.

UserLog(UserID,'Login','Member Login',DATETIME.NOW);

Now when you want to keep track on which page user gone then on every page load you can call this function with following value.

UserLog(UserID,'Usercomeson this page','User come on this page',DATETIME.NOW);

you can make one ENUM for operations.

I hope you get my idea for user tracking. May be it help you.

Thanks,
Viprat
 
Share this answer
 
You can create a xml file which is updated on events like login,log out etc.
You can create another thread which monitors the form and updates the xml file.
You have 2 options:
1.create a xml file in client,fetch it after a fixed interval.
2.create a xml file for each client in server.

in 2nd case u will get a live report on client actions.

since its xml its easy to parse the data.

Xml Tutorial
Tutorial on how to read and write to xml file using c#

since you are not much familiar to threading, you can achieve your goal by using events.
create events for the actions you wanna monitor.
when the event is triggered write the info to xml file.
cant give much info since you havent provided the code.
 
Share this answer
 
v2
Comments
yogesh a sharma 18-Oct-12 11:23am    
thanks sir but please can you provide example...??
i will be very thankfull to u...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900