Calculating Time And Some Others

toothpick
09-08-2003, 12:33 PM
ok i am currently working on a small administrator type program which i am hoping to expand on.

the user logs into the program with a login id and password which is issued to them. they are then logged into there own little area where they can view information about themself, private information and more. for this example it is at work.

i have 2 sections which i cannot code, as i am unsure how to.

1) total time logged in, from when the user logs into the login system at the start i want it to log the time he/she is logged in to there account. when the account is logged out, it will save the time and next time logged in display it. this is not a live running/moving clock while they are logged in, it simply displays the time they have been logged in previously.

2) getting the ip address. i have achived this way through winsock commands before however the program keeps wanting to use the internet that way and i dont want to use the internet at all. actually the program will not be in use, on an internet compatible machine. so i dont know if there is an easy way to pull the ip from somewhere as like the windows username and o/s modules i have. else im going to have to use the winsock way. if you know please post.

i just threw this program screenshot together so you can get a very ruff idea of what i mean, i hope it helps.

please post, i would like to hear from you all.

Zahartor
09-08-2003, 12:51 PM
Hello toothpick

I'm not sure if it's what you want, but for 1)
you can use Timer.
it will give you the clock, but if you stock it in a variable and after you do Timer - variable. It will give you the time between them.
so stock the timer in a variable at the beginning and when he quits make the difference with the timer and stock it into another variable. you can also use a file to don't loose your data each time he quits the program.

I hope it will help you.

toothpick
09-09-2003, 05:14 AM
Hello toothpick

I'm not sure if it's what you want, but for 1)
you can use Timer.
it will give you the clock, but if you stock it in a variable and after you do Timer - variable. It will give you the time between them.
so stock the timer in a variable at the beginning and when he quits make the difference with the timer and stock it into another variable. you can also use a file to don't loose your data each time he quits the program.

I hope it will help you.

thanks yea i was planning on holding the information in a text file, and data loaded from there. thanks ill look into the timer idea

as for the ip from where the user has connected. winsock the only option ? or is there a way to take this information a different way?

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum