is there anyway for a program to tell windows that a user hit the F5 key?

Started by
5 comments, last by CJWR 18 years, 8 months ago
alright, here is what i'm trying to do: my ftp server kicks out users who aren't doing anything after a certain amount of time. i do not know of any way to fix this, and can't change the settings for my ftp server even if i wanted to as i'm away at school. so i want to write a program that has windows tell IE every minute or so, to refresh the ftp file page. this way i'll still be giving the server commands and won't get kicked off. is there anyway to do this? thank you for your time.
Charles Reed, CEO of CJWR Software LLC
Advertisement
sure.. create a web page with two frames .. name one frame "bottom" and have it navigate your ftp server. In the top frame add the following &#106avascript.. and begin debuging :)

<script language="Javascript"><!--function reload() {   parent.bottom.location = "www.ftpserver.com/ftppage.html"}setTimeout("reload()", [[[50000]]]);//--></script>

may need parent.bottom.window.location I cant remember.

DaveC

[Edited by - bobason456 on August 15, 2005 6:11:24 AM]
A simple VBS script would cover it.

Refresh.vbs:
Dim WshShellSet WshShell = CreateObject("Wscript.Shell")If WshShell.AppActivate("Your FTP Window Title") = False Then     End     //Just die.End ifWhile WshShell.AppActivate("Your FTP Window Title") = True     WshShell.Sendkeys("{F5}")     Wscript.Sleep(60000)     //Send the F5 key, sleep for 60 seconds, loop. Will exit when you close the program, theoretically.Wend


That should work, although it's untested.

EDIT: That will obviously require IE to be the topmost window. You could probably do it with Internet Explorer's object - but I'm too lazy to check, I've got to run.
[TheUnbeliever]
Quote:Original post by bobason456
sure.. create a web page with two frames .. name one frame "bottom" and have it navigate your ftp server. In the top frame add the following &#106avascript.. and begin debuging :)<br><br>*** Source Snippet Removed ***<br>may need parent.bottom.window.location I cant remember.<br><br>DaveC<!--QUOTE--></td></tr></table></BLOCKQUOTE><!--/QUOTE--><!--ENDQUOTE--><br><br>first off, i'd like to thank both of you for your help so far. this &#106avascript way seems to be easy and will work. but how do i point the bottom frame of a webpage to an ftp server?
Charles Reed, CEO of CJWR Software LLC
you can navigate ftp servers in your browser (e.g. ftp://ftp.microsoft.com/). You should get prompted for user/pass on your own server, but you should only have to enter that once if the refresh is working.
i really don't know anything about html, would it possible for one of you to show me how to do this?
Charles Reed, CEO of CJWR Software LLC
bump?
Charles Reed, CEO of CJWR Software LLC

This topic is closed to new replies.

Advertisement