![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Programmer
Join Date: Mar 2005
Location: Lubbock, TX
Posts: 30
Rep Power: 0
![]() |
Simulate user activity
Hello all,
I am currently up at the university library, and the computers are set to log you off after 3 minutes of being idle. It is very annoying to say the least. I am currently working on Calculus III homework with the homework site up. The way it works is I write down the problem, work on it, then submit it. This process takes longer than three minutes, so I want to know if I could write a console program that could make the computer think that I just pushed a button every x seconds. There is Visual Studio 6.0 installed on this computer, so I can compile and run a program right here. I had already given it one try, writing this program: #include <ctime>
#include <iostream>
int main()
{
time_t start, stop;
start = time(&start);
system("TITLE ANTI-LOGOUT!");
while(true)
{
stop = time(&stop);
if(difftime(stop,start) == 60.0)
{
start = time(&start);
// This opens a minimized prompt every 60 seconds
system("cmd /c start /min cmd /c exit");
}
}
return 0;
}Thanks in advance, --David |
|
|
|
|
#2 |
|
Programmer
Join Date: Nov 2007
Posts: 33
Rep Power: 0
![]() |
Re: Simulate user activity
Have you considered why the "auto logoff" feature is really there?
Having understood that, what if you forget to turn off your magic program when you finally leave the building? If it's there for your security, then someone else will have free access to your account in a public building. Also consider that what you're trying to do could be considered by some harsh regimes as computer misuse (writing a program to circumvent a policy decision of the management). Getting bumped off your course is not what you want.
__________________
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut. |
|
|
|
|
#3 |
|
Hobbyist Programmer
Join Date: Oct 2006
Posts: 203
Rep Power: 2
![]() |
Re: Simulate user activity
Ok, mommy... ^^^
Anyway, I'm just taking a guess here (learning like you are) but I think your program doesn't work because it simulates computer activity, not user activity. Opening a window every x seconds is more similar to a system process than anything... what you probably want is to simulate an event, such as the user clicking a button or moving the mouse. The logoff feature probably checks to see if an event occured (like mouse movement or key clicks). |
|
|
|
|
#4 |
|
hi: for(;;) goto hi;
|
Re: Simulate user activity
It's not C++ source, but this is what I've used for a long time.
http://www.softpedia.com/get/Securit...Caffe1ne.shtml
__________________
How do you play Religious Roulette? Stand around in a circle and blaspheme till someone gets struck by lightning. |
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Allow user to select a directory | MegaArcon | HTML / XHTML / CSS | 11 | Jun 5th, 2006 8:38 AM |
| problem with user defined class mixed with functions | willj729 | C++ | 4 | Oct 9th, 2005 3:26 PM |
| User Input for Number Format | ericelysia1 | Java | 0 | Jul 21st, 2005 3:41 PM |
| Loading and Destroying web user controls into a panel | see07 | C# | 0 | Feb 2nd, 2005 12:38 PM |
| Show web user control hidden | see07 | C# | 1 | Feb 2nd, 2005 10:35 AM |