Teen Programmers Unite  
 

 

Return to forum top

Windows Programming ....

Posted by titusingh [send private reply] at September 01, 2002, 11:08:15 PM

We have a need in which a user would have internet access on a designated PC for only 10 minutes to check his or her email etc. Is there a way to write a program that would let that user to log in with the assigned userID and password followed by a message to remind the user that internet access on this PC would only last for 10 minutes and then after 10 minutes the program should automatically log that user out. Operating system on the machine is Windows 2000.

I will appreciate if someone could please give me a clue as to what kind of program I would need and what programming language could be used for this program.

Thanks.

Posted by CodeRed [send private reply] at September 02, 2002, 12:21:03 AM

You'd have to be more specific as to the ISP and method of connecting to the net

Posted by titusingh [send private reply] at September 02, 2002, 03:51:10 PM

Thanks for replying to my question.
Internet access would be provided straight through a DSL line without any firewall etc. if that matters ...

Thanks.

Posted by regretfuldaydreamer [send private reply] at September 02, 2002, 05:48:35 PM

What kind of email is it , web page based (like Hotmail) or POP3? Why only ten mins if you have DSL?

Posted by Psion [send private reply] at September 02, 2002, 05:52:59 PM

This would be quite easy to do with a UNIX. You could just set the user's login shell to your program, which enforces a 10 minute limit. =)

Can't say I know the details for Windows, though.

Posted by regretfuldaydreamer [send private reply] at September 02, 2002, 06:25:04 PM

If you know MFC, don't think it'd take more than a day or twos MFC programming to make some sort of IE Coating, like crazybrowser that'd do the trick. I don't know MFC though so I can't be sure

Posted by unknown_lamer [send private reply] at September 02, 2002, 06:59:09 PM

#include <sys/types.h>
#include <unistd.h>
#include <signal.h>

int main ()
{
  pid_t pid;
  pid = fork ();

  if (!pid)
     exec ("/bin/sh");
  sleep (600); /* 10 minutes */
  kill (pid, SIGTERM);
  exit (0);
}


...or something like that would work if you used a POSIX system and set that to the shell (I didn't try to compile it). I (heart) GNU/Linux. (I know, I know, OT).
Posted by regretfuldaydreamer [send private reply] at September 02, 2002, 07:03:18 PM

Hang On, the thread title is Windows Programming, so I'm presuming he's not going to use a unix flavoured OS, in fact hes says he's Win2K

Posted by unknown_lamer [send private reply] at September 02, 2002, 07:07:26 PM

Psion said "This would be quite easy to do with a UNIX. You could just set the user's login shell to your program, which enforces a 10 minute limit. =) ", I just used an concrete example to show how easy it really was (this is why POSIX is better).

Posted by sphinX [send private reply] at September 02, 2002, 08:56:58 PM

You could use that code and compile with Cygwin. Viola! Windows excecutable.

Posted by regretfuldaydreamer [send private reply] at September 02, 2002, 09:07:02 PM

Fair Enough (I'm being hypocrytical here by not adding in a humourours comment)

Posted by buzgub [send private reply] at September 03, 2002, 12:15:20 AM

You could have a program that runs on login (not sure how you'd do that) which just pops up a message, sleeps for 10 minutes, then uses the ExitWindowsEx function to log out. It would be about 10 lines of Visual Basic code; maybe less.

Posted by CodeRed [send private reply] at September 03, 2002, 11:29:18 AM

"You could have a program that runs on login (not sure how you'd do that)"

Either

1)put it in the registry under HKEY_LOCAL_MACHINE>software>microsoft>windows>currentVersion>Run

Or

2)Put it in the folder C:\Windows\System32\Config\Systemprofile\Start Menu\Programs\Startup

Posted by mop [send private reply] at September 03, 2002, 12:20:34 PM

Or execute a shell script upon logi- oh yes your not using Unix

Then wouldn't that be pretty insecure? They could just change the value of the thing.

Posted by CViper [send private reply] at September 03, 2002, 03:51:38 PM

just disable registry-editing for the user account...

Posted by buzgub [send private reply] at September 03, 2002, 11:56:29 PM

Codered, are they run on login, as was requested, or on startup? I'm not sure.

Posted by AnyoneEB [send private reply] at September 04, 2002, 07:32:03 AM

Windows 2000 supports log-on scripts, so you could put it there.

Posted by AngelOD [send private reply] at September 04, 2002, 08:48:40 AM

Or.. You could build a program that replaces the shell, deactivated the Ctrl-Alt-Del combination, and holds a login.. I've seen it done plenty of times before, and if done well it's quite hard to get around for the average user.

A system like it has been developed for various internet caf? sorta places, like EasyEverything..

Posted by CodeRed [send private reply] at September 04, 2002, 10:47:10 AM

"Codered, are they run on login, as was requested, or on startup? I'm not sure"

On login, I don't think you can make anything run until someone logs in, at least with the security profile I'm using

You must be logged in to post messages and see which you have already read.

Log on
Username:
Password:
Save for later automatic logon

Register as a new user
 
Copyright TPU 2002. See the Credits and About TPU for more information.