AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

time limit like a trial software for script, how to do it?
Goto page Previous  1, 2, 3, 4
 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
Logman



Joined: 19 Feb 2008
Posts: 55

PostPosted: Tue Aug 26, 2008 4:19 am    Post subject: Reply with quote

Hi,

I want to make Beta style trials in a compiled EXE so I did the method of downloading the file off the net and getting the date .The program is useless offline so the date thing works out well. I did a file delete on exit for the .txt. The date returned from the file looks like 26/08/08 so I trimmed the / and any zero's out to get a result like 26 8 8 and then used the numbers to compare- I figure with that information I can create a Beta for any time period. If anyone would look at this and make sure that it seems correct I would really appreciate it, I'm freaking about whether it is correct. Laughing Any improvements or comments are VERY welcome Wink
Code:


CheckExpiry:

  URLDownloadToFile,http://www.sportinglife.com/,date.txt
  FileRead,date,date.txt
  pos:= InStr(date,"clock")
  pos += 13

  StringMid, date, date,%pos%, 8



  StringTrimRight, a1var,date,6

  StringLeft, 1var, a1var, 1

  IfInString, 1Var, 0
    {
      StringTrimLeft, 1Day, a1var,1
      1Date = %1Day%
    }
  Else,
    {
      1Date = %a1var%
    }


  StringTrimRight, a2var,date,3
  StringRight, 2var, a2var, 2


  StringLeft, Bvar, 2var, 1
  IfInString, BVar, 0
    {
      StringTrimLeft, 1TMonth, 2var,1
      1Month = %1TMonth%
    }
  Else,
    {
      1Month = %2var%
    }


  StringRight, 3var, date, 2

  StringLeft, Cvar, 3var, 1
  IfInString, CVar, 0
    {
      StringTrimLeft, 1TYear, 3var,1
      1Year = %1TYear%
    }
  Else,
    {
      1Year = %3var%
    }


  TodayDate := 1Date
  ThisMonth := 1Month
  ThisYear  := 1Year 

  If (( ThisYear = 8 and ThisMonth = 8 and TodayDate >= 26 ) or ThisMonth <= 7 or ThisMonth >= 9 or ThisYear <=7 or ThisYear >= 9)

    {
      MsgBox, 1, App name, Beta version expired, would you like to check for a new Beta version?

IfMsgbox,Ok
Run http://my site

      FileDelete, Date.txt
      ExitApp
    }
Back to top
View user's profile Send private message
Logman



Joined: 19 Feb 2008
Posts: 55

PostPosted: Wed Aug 27, 2008 7:59 am    Post subject: Reply with quote

Nobody? Crying or Very sad I'd really appreciate it if one of the experienced posters would verify that this is sound, I don't have any experience with this type of thing and I shudder at the thought of it being incorrect Laughing . I'm holding off letting people use it until I know it's cool. Cool
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Goto page Previous  1, 2, 3, 4
Page 4 of 4

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group