 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
Logman
Joined: 19 Feb 2008 Posts: 55
|
Posted: Tue Aug 26, 2008 4:19 am Post subject: |
|
|
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. Any improvements or comments are VERY welcome
| 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 |
|
 |
Logman
Joined: 19 Feb 2008 Posts: 55
|
Posted: Wed Aug 27, 2008 7:59 am Post subject: |
|
|
Nobody? 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 . I'm holding off letting people use it until I know it's cool.  |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|