Jump to content



Photo

Trial time


  • Please log in to reply
5 replies to this topic

#1 usera

usera

    Prodigy

  • Active Members
  • PipPipPip
  • 188 posts

Posted 04 February 2011 - 03:50 PM

Greeting,

Want to create a small APP for customer Trial within 7 days from today. once reach 7 days, then the App just quit do nothing

How can I do that.

Thanks
usera







#2 Manadar

Manadar

    Taking a REST.

  • MVPs
  • 10,714 posts

Posted 04 February 2011 - 03:55 PM

There is a library of functions that can do this for you: http://www.autoitscript.com/forum/topic/31020-xprotecau3-automated-protect-and-get-paid/

Never implemented it myself, but have heard nothing but good things.

#3 guinness

guinness

    guinness

  • MVPs
  • 10,426 posts

Posted 04 February 2011 - 03:59 PM

A quick simple Function I had lying around >>
Function:
; #FUNCTION# ==================================================================================================================== ; Name ..........: _TrialPeriod ; Description ...: Check if a trial period has expried. ; Syntax ........: _TrialPeriod($sDateString, $iDays[, $iIsUSDate = 0]) ; Parameters ....: $sDateString         - Start date of trial period. e.g. 01/01/2000 ;                  $iDays               - Number of days for trial period. ;                  $iIsUSDate           - [optional] Set to 1 if using a US formatted date. Default is 0. ; Return values .: Success - 1 ;                  Failure - 0 ; Author ........: guinness ; Example .......: Yes ; =============================================================================================================================== Func _TrialPeriod($sDateString, $iDays, $iIsUSDate = 0)     Local $aFormat[2] = ['$3/$2/$1', '$3/$1/$2']     Return (_DateDiff('D', StringRegExpReplace($sDateString, 'A(d*)/(d*)/(d*)', $aFormat[$iIsUSDate]), @YEAR & '/' & @MON & '/' & @MDAY) > $iDays) EndFunc   ;==>_TrialPeriod

Example use of Funtion:
#include <Date.au3> ; Required For _DateDiff() If _TrialPeriod('28/05/2012', 2, 0) Then ; UK date with a 2 day trial period.     MsgBox(0, '_TrialPeriod()', 'Time Is Up!') EndIf If _TrialPeriod('05/28/2012', 5, 1) Then ; US date with a 5 day trial period.     MsgBox(0, '_TrialPeriod()', 'Time Is Up!') EndIf

Edited by guinness, 27 May 2012 - 10:17 PM.

Example List: _AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_DesktopDimensions()_DisplayPassword()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUISetIcon()_Icon_Clear()/_Icon_Set()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringIsValid()_StringReplaceWholeWord()_StringStripChar()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()AutoIt SearchAutoIt3 PortableAutoItWinGetTitle()/AutoItWinSetTitle()CodingFileInstallrGeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIGetBkColor()LockFile()PasteBinSciTE JumpSignature CreatorWM_COPYDATAMore Examples...Updated: 11/04/2013


#4 usera

usera

    Prodigy

  • Active Members
  • PipPipPip
  • 188 posts

Posted 04 February 2011 - 04:01 PM

There is a library of functions that can do this for you: http://www.autoitscript.com/forum/topic/31020-xprotecau3-automated-protect-and-get-paid/

Never implemented it myself, but have heard nothing but good things.



Thanks for that quick feedback.

The link you provide for me (newbie) is too hard.

usera

#5 usera

usera

    Prodigy

  • Active Members
  • PipPipPip
  • 188 posts

Posted 04 February 2011 - 04:11 PM

Thanks for that quick feedback.

The link you provide for me (newbie) is too hard.

usera



Please ignore this. _NowCalcDate() did help

usera

#6 engjcowi

engjcowi

    Polymath

  • Active Members
  • PipPipPipPip
  • 245 posts

Posted 28 May 2011 - 01:59 PM

Very useful thanks
Drunken Frat-Boy Monkey Garbage




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users