Results 1 to 4 of 4

Thread: leave prog running on server???

  1. #1

    Thread Starter
    Hyperactive Member pgrimes's Avatar
    Join Date
    Aug 2001
    Location
    sacramento
    Posts
    342

    leave prog running on server???

    A lot of you have probably seen my posts recently on how I can get my prog to open from asp or dll or something. That doesn't seem to be working for me.

    Tell me if this is a real bad idea or not.

    I was thinking of having my program stay running constantly on the server. I can put it into a loop, constantly checking to see if a file exists... if the file does exist, it will read in the first line (which, will be the pathname for a variable my prog uses) and do the stuff it needs to do, then delete the file. Whenever somebody clicks a certain thing on the web, the asp will create the file again, and write the pathname in it. etc. It's pretty simple, and I have it so it works, just wondering about system resources and stuff.

    bad idea or no?

    thanks,

    Paul

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333
    The only true way of knowing what system resources will be used up is to try for a while, and keep monitoring the server. There are lots of people who keep programs running constantly on servers. Whether it is a good idea or a bad idea depends a lot on the horsepower of your server and the dictates of your situation.

  3. #3

    Thread Starter
    Hyperactive Member pgrimes's Avatar
    Join Date
    Aug 2001
    Location
    sacramento
    Posts
    342
    does this code look ok? or is ther something better you can think of?

    VB Code:
    1. Private Sub Form_Load()
    2. Dim strPathToFile As String
    3. Dim cptPath As String
    4.  
    5. strPathToFile = "C:\Inetpub\wwwroot\cpthandler\simpleTest\filePath.txt"
    6.  
    7. Do While Exists(strPathToFile)
    8.  
    9. If Exists(strPathToFile) = True Then
    10.  
    11.  Open strPathToFile For Input As #1
    12.  
    13.  Line Input #1, cptPath
    14.  
    15.     MsgBox (cptPath)
    16.     'My app code will be here instead of msgbox
    17.    
    18.  Close #1
    19.  Kill (strPathToFile)
    20.  
    21. Else
    22.  
    23.   Sleep (500)
    24.  
    25.  
    26. End If
    27.  
    28. If Exists("C:\Inetpub\wwwroot\stop\stop.txt")
    29.  End
    30. End If
    31.  
    32. Loop
    33.  
    34. End
    35.  
    36. End Sub

  4. #4

    Thread Starter
    Hyperactive Member pgrimes's Avatar
    Join Date
    Aug 2001
    Location
    sacramento
    Posts
    342
    whadda ya think?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width