lidds Posted July 26, 2005 Posted July 26, 2005 Hi ya all, I need a bit of advice on this one as I am unsure of the best way to do this :( , so all feedback would be appreshiated. I want to hold who is logged into my application, what I was just thinking was to have a logged in table within my database and when the user successfully log's in then the information is writen back e.g. username, date and time entered, machine number. The only problem with this is a couple of things 1) if my app crashes (hopefully not, but the user might do something strange :confused: ) then how would I ensure that the user is removed from the table? 2) If the user logs into the app more than once (different machine, or on the same machine) how would I ensure that when the user closes one of the app's that it removes the correct entry from the logged in table? Would need something like unique sessionID in webpages (PHP etc.). I'll tell you the reason why I am doing this, is incase the administrator needs to do something with my app's database i.e. compress, restore etc. then he will know who is logged in from the table, but I obviously want it to be accurate. Also I was holding the user's machine number as I was intending in sending a message to the users machine to tell them to exit the app. does anyone have any suggestions or code on how to do this??? Anyway that was what I was thinking, or is there a better way??? Thanks Simon Quote
rot13 Posted July 26, 2005 Posted July 26, 2005 You need to have a collection of RemoteEndPoints in the application, and have a way for the admin to view them through the app... not through the db... Just a bit of help: To get the IP from a RemoteEndPoint you have to do something like this (off the top of my head) DirectCast(RemoteEndPoint1, IPEndPoint).Address EDIT: You should have a collection of socket, and get the RemoteEndPoint from then... not have a collection of RemoteEndPoints... Also, I take it youve never done socket work before... just be patient... it gets annoying trying to learn it... but it pays off Quote
lidds Posted July 26, 2005 Author Posted July 26, 2005 Thanks for you help with all the question today. In answer to your question, have never done sockets and to be honest only started using vb.net about 3/4 year ago. Don't suppose you have any examples, links or good books to help me out??? Thanks Simon Quote
rot13 Posted July 26, 2005 Posted July 26, 2005 Just look a code snippets that are all over the net... basically i just started messing with it till i figured it out... after looking a few code snippets that is. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.